/* ============================================================
   MediaHub · 视觉样式 v2
   ============================================================ */
:root {
  --bg: #f4f3ee;
  --bg-tint-1: #e9f2ec;
  --bg-tint-2: #f7efe2;
  --surface: #ffffff;
  --surface-soft: #fbfaf6;
  --ink: #14161a;
  --ink-2: #3b3e46;
  --muted: #71747c;
  --faint: #9b9e9d;
  --line: #e7e4dc;
  --line-strong: #d5d2c7;
  --accent: #0f6b4f;
  --accent-600: #0c5941;
  --accent-300: #84c6ab;
  --accent-soft: #e6f2ec;
  --danger: #b8452f;
  --radius-sm: 10px;
  --radius: 15px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(20, 24, 20, .05);
  --shadow-sm: 0 2px 6px -2px rgba(20, 24, 20, .08), 0 1px 2px rgba(20, 24, 20, .04);
  --shadow-md: 0 18px 40px -22px rgba(16, 30, 24, .45), 0 4px 10px -6px rgba(16, 30, 24, .18);
  --shadow-lg: 0 40px 90px -40px rgba(12, 22, 18, .55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: #cfe9dd; color: #0b3d2d; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 13.5px; letter-spacing: .01em;
  transition: background .16s, border-color .16s, transform .14s, box-shadow .16s, color .16s;
  white-space: nowrap;
}
.btn:hover { background: #faf9f5; border-color: #c4c0b3; box-shadow: var(--shadow-xs); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary {
  background: linear-gradient(150deg, #148061 0%, #0c5941 100%);
  border-color: #0b4f3a; color: #fff;
  box-shadow: 0 1px 2px rgba(12, 60, 44, .35), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn.primary:hover { background: linear-gradient(150deg, #168a68 0%, #0a4b38 100%); border-color: #083f2f; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(20, 24, 20, .05); border-color: transparent; box-shadow: none; }
.btn.block { width: 100%; height: 46px; border-radius: 12px; }
.btn.danger { color: var(--danger); border-color: #e9d5ce; background: #fff; }
.btn.danger:hover { background: #fdf4f1; border-color: #dcbdb2; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-fill:hover { background: #a03a26; border-color: #a03a26; }
.btn.danger-fill[disabled] { opacity: .45; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.tiny { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.tiny code { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 11px; }
.err { color: var(--danger); font-size: 12.5px; margin-top: 10px; line-height: 1.5; }
.select {
  height: 34px; padding: 0 30px 0 11px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2371747c' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.select:hover { border-color: #c4c0b3; }
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 107, 79, .12); }

/* ============================================================
   登录 / 注册
   ============================================================ */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  background:
    radial-gradient(720px 460px at 8% -12%, var(--bg-tint-1) 0%, rgba(233, 242, 236, 0) 62%),
    radial-gradient(680px 520px at 98% 112%, var(--bg-tint-2) 0%, rgba(247, 239, 226, 0) 58%),
    var(--bg);
}
.auth-card {
  width: min(980px, 100%);
  display: grid; grid-template-columns: 1.02fr .98fr;
  background: var(--surface); border: 1px solid rgba(20, 24, 20, .07);
  border-radius: 26px; overflow: hidden;
  box-shadow: 0 40px 90px -50px rgba(14, 30, 24, .55), 0 2px 6px rgba(20, 24, 20, .04);
}
.auth-brand {
  position: relative; overflow: hidden;
  padding: 46px 42px 34px; display: flex; flex-direction: column; gap: 20px;
  background: linear-gradient(158deg, #10513c 0%, #0b2c23 58%, #081d18 100%);
  color: #eef4f0;
}
.auth-brand::before {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 460px; height: 460px;
  background: radial-gradient(circle at 30% 30%, rgba(132, 198, 171, .35), transparent 62%);
}
.auth-brand::after {
  content: ""; position: absolute; right: -190px; bottom: -210px; width: 440px; height: 440px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 0 0 44px rgba(255, 255, 255, .035), 0 0 0 104px rgba(255, 255, 255, .022);
}
.brand-line { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: .03em; position: relative; z-index: 1; }
.brand-line em { font-style: normal; opacity: .5; font-weight: 500; letter-spacing: .1em; font-size: 10.5px; text-transform: uppercase; }
.logo-mark { width: 30px; height: 30px; flex: none; border-radius: 9px; }
.auth-brand h1 { font-size: 35px; line-height: 1.28; letter-spacing: -.015em; font-weight: 700; margin-top: 6px; position: relative; z-index: 1; }
.auth-sub { color: rgba(238, 244, 240, .66); font-size: 13.5px; line-height: 1.8; max-width: 330px; position: relative; z-index: 1; }
.auth-points { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: baseline; font-size: 13px; color: rgba(238, 244, 240, .82); }
.auth-points b { color: #93d3b9; font-size: 10.5px; letter-spacing: .08em; font-weight: 700; }
.auth-foot { margin-top: auto; font-size: 10.5px; color: rgba(238, 244, 240, .38); letter-spacing: .08em; position: relative; z-index: 1; }

.auth-form { padding: 40px 40px 34px; display: flex; flex-direction: column; gap: 13px; }
.auth-form h2 { font-size: 20px; letter-spacing: -.015em; margin: 2px 0 0; }
.auth-form .hint { color: var(--muted); font-size: 12.5px; margin: 2px 0 6px; }
.accounts { display: grid; gap: 6px; margin: 8px 0 4px; max-height: 268px; overflow: auto; padding-right: 2px; }
.account {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  text-align: left; transition: border-color .15s, background .15s, box-shadow .15s, transform .15s;
}
.account:hover { border-color: #c9c5b8; background: var(--surface-soft); transform: translateX(1px); }
.account.is-active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(15, 107, 79, .08); }
.account .avatar { width: 32px; height: 32px; font-size: 13px; }
.account-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.account-meta b { font-size: 13px; font-weight: 600; }
.account-meta small { color: var(--muted); font-size: 11px; }
.account .role {
  margin-left: auto; font-size: 10px; letter-spacing: .05em; color: var(--accent-600);
  background: #d9eee4; border-radius: 999px; padding: 2px 9px; font-weight: 700;
}
.account .role.mgr { background: #e8eef6; color: #2f4f7a; }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 2px; }
.field > span { font-size: 12px; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }
.field input, .field textarea, .field select {
  width: 100%; height: 42px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 76px; line-height: 1.65; }
.field input:hover, .field textarea:hover { border-color: #c4c0b3; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 107, 79, .12);
}

.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(150deg, #1d7a58, #0d5440); color: #fff;
  font-size: 12px; font-weight: 700; flex: none; letter-spacing: .02em;
}

/* ============================================================
   应用骨架
   ============================================================ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: none; padding: 20px 14px 14px;
  border-right: 1px solid var(--line); background: var(--surface);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 8px; z-index: 30;
  box-shadow: 1px 0 0 rgba(20, 24, 20, .02);
}
.sidebar .brand-line { padding: 2px 8px 16px; font-size: 15.5px; }
.sidebar .logo-mark { width: 27px; height: 27px; }

.nav { display: grid; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 0; border-radius: 10px; background: transparent;
  font-size: 13.5px; color: var(--ink-2); text-align: left; font-weight: 500;
  transition: background .14s, color .14s, box-shadow .14s;
}
.nav-item:hover { background: #f3f1ea; }
.nav-item.is-active {
  background: var(--surface); color: var(--accent-600); font-weight: 650;
  box-shadow: 0 1px 2px rgba(20, 24, 20, .07), 0 0 0 1px rgba(20, 24, 20, .04);
}
.nav-ico { width: 16px; text-align: center; font-size: 12px; color: var(--faint); transition: color .14s; }
.nav-item.is-active .nav-ico { color: var(--accent); }
.count { margin-left: auto; font-style: normal; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav-item.is-active .count { color: var(--accent); }

.side-block { margin-top: 18px; }
.side-label {
  font-size: 11px; letter-spacing: .14em;
  color: #8f9189; font-weight: 700; padding: 0 12px 10px;
}
.cat-list { display: grid; gap: 4px; padding: 0 2px; }
.cat-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 12px 12px; border: 1px solid transparent; border-radius: 11px;
  background: transparent; text-align: left;
  font-size: 14.5px; font-weight: 550; color: var(--ink-2);
  transition: background .16s, color .16s, box-shadow .16s, transform .16s;
}
.cat-dot {
  width: 10px; height: 10px; border-radius: 3px; flex: none;
  background: var(--cat, #a9aca4);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
  transition: background .16s;
}
.cat-item:hover { background: #f3f1ea; color: var(--ink); }
.cat-item:hover .cat-dot { transform: scale(1.15); }
.cat-item:active { transform: scale(.995); }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count {
  font-style: normal; font-size: 12px; font-weight: 650; color: var(--muted);
  background: #efede6; border-radius: 999px; padding: 2px 9px;
  font-variant-numeric: tabular-nums; min-width: 28px; text-align: center;
}
.cat-item.is-active {
  background: var(--cat, #12805f);
  color: #fff; font-weight: 700;
  box-shadow: 0 8px 18px -10px rgba(20, 24, 20, .5);
}
.cat-item.is-active .cat-dot { background: rgba(255, 255, 255, .92); box-shadow: none; }
.cat-item.is-active .cat-count { background: rgba(255, 255, 255, .22); color: #fff; }
.side-foot { margin-top: auto; position: relative; padding-top: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px;
  border: 1px solid var(--line); background: var(--surface-soft); border-radius: 12px; text-align: left;
  transition: border-color .15s, background .15s;
}
.user-chip:hover { background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-meta b { font-size: 12.5px; font-weight: 650; }
.user-meta small { font-size: 10.5px; color: var(--muted); }
.caret { margin-left: auto; color: var(--faint); font-size: 12px; }
.menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow-md); padding: 5px; display: grid;
  animation: menuIn .16s ease;
}
@keyframes menuIn { from { opacity: 0; transform: translateY(4px); } }
.menu button {
  border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 12.5px;
  transition: background .14s;
}
.menu button:hover { background: var(--surface-soft); }

/* ---------- 主区 ---------- */
.main {
  flex: 1; min-width: 0;
  background:
    radial-gradient(900px 520px at 78% -18%, rgba(233, 242, 236, .85) 0%, rgba(233, 242, 236, 0) 60%),
    var(--bg);
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 15px 32px;
  background: rgba(244, 243, 238, .78);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(20, 24, 20, .06);
}
.search {
  position: relative; flex: 1; max-width: 640px; height: 44px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 13px; padding: 0 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color .16s, box-shadow .16s;
}
.search:hover { border-color: #c9c5b8; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 107, 79, .12); }
.search svg { width: 17px; height: 17px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 13.5px; min-width: 0; }
.search input::placeholder { color: #a5a7a2; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd {
  font-family: inherit; font-size: 10.5px; color: var(--faint); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; background: var(--surface-soft);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.toolbar { display: flex; align-items: center; gap: 16px; padding: 20px 32px 10px; }
.tabs { display: inline-flex; padding: 3px; background: #eae7de; border-radius: 11px; gap: 2px; }
.tab {
  border: 0; background: transparent; padding: 7px 16px; border-radius: 9px;
  font-size: 12.5px; color: var(--ink-2); font-weight: 550; transition: all .16s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow-xs); }
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.result-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 32px 0; }
.chip-filter {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 4px 10px; font-size: 11.5px; color: var(--ink-2); box-shadow: var(--shadow-xs);
}
.chip-filter b { font-weight: 650; }
.chip-filter .x { border: 0; background: none; color: var(--faint); font-size: 13px; line-height: 1; padding: 0 1px; }
.chip-filter .x:hover { color: var(--danger); }

.content { padding: 18px 32px 70px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; cursor: pointer;
  box-shadow: 0 1px 2px rgba(20, 24, 20, .04);
  transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s, border-color .2s;
  outline: none;
}
.card:hover, .card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px -24px rgba(15, 40, 30, .5), 0 4px 12px -8px rgba(15, 40, 30, .2);
  border-color: #d8d4c8;
}
.card-media { position: relative; aspect-ratio: 4 / 3; background: #e9e6de; overflow: hidden; }
.card-media::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 38%;
  background: linear-gradient(180deg, rgba(10, 14, 12, 0) 0%, rgba(10, 14, 12, .22) 100%);
  pointer-events: none; opacity: .9;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}
.card:hover .card-media img { transform: scale(1.05); }
.card-media.noimg::after { content: "▷"; display: grid; place-items: center; font-size: 34px; color: #b5b1a4; }
.chip {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(14, 17, 18, .55); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px; padding: 2px 8px; font-size: 10.5px; font-weight: 650; letter-spacing: .02em;
}
.chip.lock { left: auto; right: 10px; background: rgba(255, 255, 255, .92); color: var(--ink-2); border-color: rgba(20, 24, 20, .06); }
.card-actions {
  position: absolute; right: 9px; bottom: 9px; display: flex; gap: 6px; z-index: 3;
  opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s;
}
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; transform: none; }
.icon-btn {
  width: 31px; height: 31px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: rgba(255, 255, 255, .95); color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22); transition: background .15s, transform .15s;
}
.icon-btn:hover { background: #fff; transform: translateY(-1px); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.card-body { padding: 12px 14px 14px; }
.card-title {
  font-size: 13.5px; font-weight: 600; line-height: 1.45; letter-spacing: -.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-meta {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  margin-top: 7px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.card-meta .category { display: inline-flex; align-items: center; gap: 5px; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta .category::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--cat, var(--accent-300)); flex: none; }

/* ---------- 空状态 / 加载更多 / 骨架 ---------- */
.empty { text-align: center; padding: 96px 20px; color: var(--muted); }
.empty-art {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; color: var(--accent);
  background: var(--accent-soft); border: 1px solid #d6e9e0;
}
.empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 6px; font-weight: 650; }
.empty p { font-size: 12.5px; margin-bottom: 20px; }
.loadmore { display: flex; justify-content: center; padding: 32px 0 0; }
.skeleton { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.skeleton .sk-media {
  aspect-ratio: 4/3;
  background: linear-gradient(100deg, #eeece5 30%, #f7f6f1 50%, #eeece5 70%);
  background-size: 220% 100%; animation: shimmer 1.3s infinite linear;
}
.skeleton .sk-line { height: 10px; margin: 12px 14px; border-radius: 5px; background: #f1efe8; }
.skeleton .sk-line.short { width: 52%; margin-top: 0; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ============================================================
   弹层
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 26px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(12, 16, 15, .58); backdrop-filter: blur(6px); animation: fade .18s ease; }
.modal-panel {
  position: relative; background: var(--surface); border-radius: 22px;
  width: min(1080px, 100%); max-height: calc(100vh - 52px);
  box-shadow: var(--shadow-lg);
  animation: pop .24s cubic-bezier(.2, .8, .3, 1); overflow: hidden;
}
.modal-panel.sheet { width: min(760px, 100%); display: flex; flex-direction: column; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .94); color: var(--ink-2); font-size: 17px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 2px 12px rgba(0, 0, 0, .16);
  transition: background .15s, transform .15s;
}
.modal-close:hover { background: #fff; transform: rotate(90deg); }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 56px 18px 24px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 16px; letter-spacing: -.01em; }
.modal-head .sub { font-size: 12px; color: var(--muted); margin-left: 2px; }
.modal-body { padding: 22px 24px; overflow: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 10px; padding: 14px 24px;
  border-top: 1px solid var(--line); background: var(--surface-soft);
}
.modal-foot .spacer { flex: 1; }

/* ---------- 详情 ---------- */
.modal-panel.detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .85fr); }
.detail-preview {
  background: radial-gradient(120% 100% at 50% 0%, #17191d 0%, #0c0d10 100%);
  display: grid; place-items: center; overflow: hidden; min-height: 420px;
}
.detail-preview img { max-width: 100%; max-height: calc(100vh - 52px); object-fit: contain; display: block; }
.detail-preview video { width: 100%; max-height: calc(100vh - 52px); background: #000; display: block; }
.detail-side { padding: 28px 26px; overflow: auto; max-height: calc(100vh - 52px); display: flex; flex-direction: column; }
.detail-kind {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-size: 10.5px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase;
  color: var(--accent-600); background: var(--accent-soft); border-radius: 999px; padding: 3px 11px;
}
.detail-side h2 { font-size: 21px; line-height: 1.38; margin: 14px 0 10px; letter-spacing: -.015em; }
.detail-desc { font-size: 13px; color: var(--ink-2); line-height: 1.75; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 4px; }
.detail-tags span { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 7px; padding: 2px 9px; font-size: 11.5px; color: var(--ink-2); }
.meta-list { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 10px; }
.meta-row { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; }
.meta-row span { color: var(--muted); width: 64px; flex: none; }
.meta-row b { font-weight: 550; color: var(--ink-2); }
.detail-actions { margin-top: auto; padding-top: 24px; display: flex; gap: 9px; flex-wrap: wrap; }
.edit-grid { display: grid; gap: 10px; margin-top: 4px; }

/* ---------- 上传 ---------- */
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: 16px; background: var(--surface-soft);
  padding: 32px 20px; text-align: center; transition: border-color .16s, background .16s;
}
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ico { font-size: 26px; color: var(--accent); margin-bottom: 6px; }
.drop p { font-size: 13px; color: var(--ink-2); }
.drop .tiny { margin-top: 6px; }
.queue { display: grid; gap: 8px; margin-top: 12px; }
.qrow {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto auto; gap: 11px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: var(--surface);
}
.qthumb {
  width: 54px; height: 42px; border-radius: 8px; background: #e9e6de; overflow: hidden;
  display: grid; place-items: center; color: #b3aea0; font-size: 15px;
}
.qthumb img { width: 100%; height: 100%; object-fit: cover; }
.qmain { min-width: 0; display: grid; gap: 4px; }
.qtitle { border: 0; background: none; font-size: 12.5px; font-weight: 600; padding: 0; outline: none; width: 100%; }
.qtitle:focus { color: var(--accent-600); }
.qsub { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qbar { height: 3px; border-radius: 2px; background: #eae7de; overflow: hidden; }
.qbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-300), var(--accent)); transition: width .2s; }
.qstatus { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.qstatus.ok { color: var(--accent-600); font-weight: 600; }
.qstatus.bad { color: var(--danger); }
.qremove { border: 0; background: none; color: var(--faint); font-size: 15px; line-height: 1; padding: 4px; border-radius: 6px; }
.qremove:hover { color: var(--danger); background: #fdf4f1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: flex; gap: 6px; }
.seg label {
  flex: 1; display: flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 8px; font-size: 12px; cursor: pointer;
  white-space: nowrap; transition: border-color .15s, background .15s;
}
.seg label:hover { border-color: #c9c5b8; background: var(--surface-soft); }
.seg input { width: auto; height: auto; padding: 0; margin: 0; border: 0; flex: none; accent-color: var(--accent); }
.seg label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; color: var(--accent-600); }

/* ---------- 管理后台 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 15px;
  background: linear-gradient(180deg, #fff 0%, var(--surface-soft) 100%);
}
.stat b { display: block; font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { font-size: 11px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; padding: 9px 8px; border-bottom: 1px solid var(--line);
}
.table td { padding: 9px 8px; border-bottom: 1px solid #f1efe8; color: var(--ink-2); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfaf6; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.section-title { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #a0a29c; font-weight: 700; margin: 24px 0 8px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; }
.toast {
  background: rgba(20, 22, 24, .94); color: #fff; border-radius: 11px; padding: 10px 17px; font-size: 12.5px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55); animation: toastIn .22s ease;
  display: flex; align-items: center; gap: 8px; max-width: 80vw; backdrop-filter: blur(8px);
}
.toast.ok::before { content: "✓"; color: #7fd0ae; font-weight: 700; }
.toast.err::before { content: "!"; color: #ffb0a0; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   批量选择
   ============================================================ */
#btnBatch.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-600); font-weight: 650; }

.card-check {
  position: absolute; top: 10px; left: 10px; z-index: 4;
  width: 20px; height: 20px; border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, .9); background: rgba(16, 18, 20, .42);
  display: none; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700; line-height: 1;
  backdrop-filter: blur(3px); transition: background .15s, border-color .15s;
}
.grid.batch .card-check { display: grid; }
.grid.batch .card .chip { display: none; }
.grid.batch .card-actions { display: none; }
.grid.batch .card:hover .card-media img { transform: none; }
.card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(15, 107, 79, .28); }
.card.is-selected .card-check { background: var(--accent); border-color: var(--accent); }

.batchbar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 15px;
  box-shadow: 0 24px 50px -20px rgba(20, 30, 24, .5); padding: 10px 14px;
  animation: pop .2s ease; backdrop-filter: blur(10px);
}
.batchbar .batch-count { font-size: 12.5px; font-weight: 650; min-width: 74px; }
.btn.mini-wide { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }

/* 回收站 */
.trash-card { cursor: default; }
.trash-actions { display: flex; gap: 6px; margin-top: 9px; }
.trash-actions .btn { flex: 1; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1080px) {
  .modal-panel.detail { grid-template-columns: 1fr; }
  .detail-preview { min-height: 300px; }
  .detail-side { max-height: none; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; gap: 10px; }
  .toolbar, .chips, .content { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 13px; }
  .search kbd { display: none; }
  .modal { padding: 10px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .batchbar { left: 12px; right: 12px; transform: none; flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .auth-card { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; gap: 14px; }
  .auth-brand h1 { font-size: 26px; }
  .auth-points, .auth-foot { display: none; }
  .auth-form { padding: 24px; }
  .result-count { display: none; }
  .card-body { padding: 10px 11px 12px; }
  .card-title { font-size: 12.5px; }
}

/* 视频：点击才加载 */
.video-shell {
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center; cursor: pointer;
  min-height: 420px;
}
.video-shell > img { max-width: 100%; max-height: calc(100vh - 52px); object-fit: contain; display: block; }
.video-shell > video { width: 100%; max-height: calc(100vh - 52px); background: #000; display: block; }
.video-play {
  position: absolute; width: 74px; height: 74px; border-radius: 50%;
  border: 0; cursor: pointer; color: #fff; font-size: 26px; line-height: 1;
  display: grid; place-items: center;
  background: rgba(16, 18, 20, .52); backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(255, 255, 255, .28);
  transition: transform .16s, background .16s;
}
.video-play span { margin-left: 4px; }
.video-shell:hover .video-play { transform: scale(1.06); background: rgba(15, 107, 79, .78); }
.video-hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; color: rgba(255, 255, 255, .72); letter-spacing: .02em;
  background: rgba(12, 14, 16, .45); padding: 4px 12px; border-radius: 999px;
  backdrop-filter: blur(6px); white-space: nowrap;
}

/* 备案信息页脚 */
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; letter-spacing: .01em; color: var(--muted);
  background: rgba(244, 243, 238, .82); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(24, 26, 28, .06);
  z-index: 45;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #12805f; }
/* 给底部留出页脚高度，避免遮挡内容 */
.auth { padding-bottom: 34px; }
.main { padding-bottom: 34px; }
.batchbar { bottom: 30px !important; }

/* 页脚存在时，侧边栏底部留出空间，避免用户卡片被压 */
.sidebar { padding-bottom: 40px; }
