/* =========================================================
   素材库系统  样式表
   ========================================================= */

:root {
  --bg: #f6f4ed;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #1c2a25;
  --ink-2: #46554d;
  --muted: #8a938b;
  --line: #e9e4d7;
  --line-2: #f1eee5;
  --brand: #1f4a3d;
  --brand-600: #2a5e4d;
  --brand-100: #e6eee9;
  --brand-50: #f2f7f4;
  --gold: #c08a3e;
  --gold-100: #f7eeda;
  --danger: #c24b3f;
  --danger-100: #fbeae7;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(28, 42, 37, 0.05);
  --shadow: 0 12px 34px rgba(28, 42, 37, 0.1);
  --shadow-lg: 0 24px 70px rgba(20, 32, 27, 0.18);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.pc-only { display: inline; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }
a { color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d9d3c3; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #c3bbaa; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--surface);
  color: var(--ink);
  transition: all 0.16s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { flex: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(31, 74, 61, 0.22); }
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: #d8d2c2; }
.btn-light { background: var(--surface-2); border-color: var(--line); }
.btn-light:hover { background: #f4f1e8; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a83f34; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: #eccac5; }
.btn-danger-ghost:hover { background: var(--danger-100); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; padding: 12px 16px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }

.mini-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 6px;
}
.mini-link:hover { color: var(--brand); background: var(--brand-50); }

/* ---------------- 登录 ---------------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(900px 480px at 12% 8%, #eef1e6 0%, transparent 60%),
    radial-gradient(700px 400px at 92% 92%, #f4ead8 0%, transparent 55%),
    var(--bg);
}
.login-card {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-2);
  min-height: 580px;
}
.login-brand {
  position: relative;
  padding: 38px 40px;
  color: #ecf2ee;
  background:
    radial-gradient(520px 300px at 85% 0%, rgba(192, 138, 62, 0.28), transparent 62%),
    radial-gradient(500px 420px at 0% 100%, rgba(94, 143, 128, 0.4), transparent 65%),
    linear-gradient(160deg, #1f4a3d 0%, #17392f 55%, #122c25 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.55;
  pointer-events: none;
}
.lb-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.lb-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(232, 217, 181, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.lb-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-copy { margin-top: 72px; position: relative; z-index: 1; }
.lb-copy h1 {
  font-size: 34px;
  line-height: 1.5;
  font-weight: 600;
  margin: 0;
  letter-spacing: 1.5px;
}
.lb-foot { margin-top: auto; font-size: 11px; color: rgba(236, 242, 238, 0.45); letter-spacing: 0.5px; position: relative; z-index: 1; }

.login-form-wrap { padding: 48px 46px; display: flex; align-items: center; }
.login-form { width: 100%; }
.lf-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: 1px; font-weight: 600; }
.lf-head p { margin: 0 0 30px; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 74, 61, 0.08);
}
.field textarea { resize: vertical; min-height: 76px; }

/* 密码可见切换 */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border: none; background: none;
  border-radius: 8px;
  color: #9aa39a;
  display: grid; place-items: center;
  transition: color 0.15s, background 0.15s;
}
.pw-toggle:hover { color: var(--ink-2); background: rgba(31, 74, 61, 0.06); }
.pw-toggle.on { color: var(--brand); }
.pw-toggle .i-off { display: none; }
.pw-toggle.on .i-off { display: block; }
.pw-toggle.on .i-on { display: none; }
.form-error {
  background: var(--danger-100);
  color: var(--danger);
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 9px;
  margin-bottom: 12px;
}

/* ---------------- 登录成功过场 ---------------- */
.login-transition {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background:
    radial-gradient(560px 340px at 50% 38%, rgba(192, 138, 62, 0.22), transparent 68%),
    radial-gradient(700px 460px at 50% 110%, rgba(94, 143, 128, 0.28), transparent 62%),
    linear-gradient(160deg, #1f4a3d 0%, #17392f 58%, #112a23 100%);
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}
.login-transition::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6;
}
.login-transition.in { opacity: 1; pointer-events: auto; }
.login-transition.out { opacity: 0; }
.lt-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  transition: opacity 0.42s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.login-transition.in .lt-box { opacity: 1; transform: none; }
.lt-mark { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.lt-spin {
  position: absolute; inset: 0;
  width: 104px; height: 104px;
  animation: ltSpin 1.1s linear infinite;
}
.lt-arc { stroke-dasharray: 24 265; animation: ltDash 1.1s ease-in-out infinite; }
@keyframes ltSpin { to { transform: rotate(360deg); } }
@keyframes ltDash {
  0% { stroke-dasharray: 24 265; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 170 119; }
  100% { stroke-dasharray: 24 265; stroke-dashoffset: -265; }
}
.lt-logo {
  width: 68px; height: 68px;
  border-radius: 17px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}
.lt-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lt-badge {
  position: absolute; right: 2px; bottom: 4px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #3f9068;
  border: 2px solid #14312a;
  display: grid; place-items: center;
  opacity: 0;
  transform: scale(0.4);
}
.login-transition.in .lt-badge { animation: ltPop 0.42s 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
@keyframes ltPop { to { opacity: 1; transform: scale(1); } }
.lt-text { text-align: center; color: #ecf2ee; }
.lt-text strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: 3px; }
.lt-text span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  letter-spacing: 0.6px;
  color: rgba(236, 242, 238, 0.55);
}

/* 主界面入场 */
.app { animation: appIn 0.5s ease both; }
@keyframes appIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .lt-spin { animation: none; }
  .lt-arc { animation: none; stroke-dasharray: 200 89; }
  .app { animation: none; }
  .lt-box { transition: opacity 0.3s ease; transform: none; }
}

/* ---------------- 登录成功过场 结束 ---------------- */

/* ---------------- 应用框架 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 242px;
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-2);
}
.sb-logo {
  width: 38px; height: 38px; border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  flex: none;
}
.sb-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sb-title { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.sb-title strong { font-size: 14.5px; letter-spacing: 0.5px; }
.sb-title span { font-size: 10.5px; color: var(--muted); letter-spacing: 0.3px; }
.sb-close { display: none; margin-left: auto; background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; }

.sb-nav { padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 3px; }
.sb-nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}
.sb-nav button:hover { background: var(--surface-2); color: var(--ink); }
.sb-nav button.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.sb-nav button.active svg { opacity: 1; }
.sb-nav svg { opacity: 0.72; flex: none; }
.sb-nav .nav-count { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 400; }

.sb-section { padding: 8px 12px 6px; overflow-y: auto; flex: 1; }
.sb-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 6px 11px;
  font-size: 11px; color: var(--muted); letter-spacing: 1.2px;
}
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-item {
  display: flex; align-items: center; gap: 9px;
  border: none; background: transparent;
  border-radius: 9px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.15s, color 0.15s;
  width: 100%;
}
.cat-item:hover { background: var(--surface-2); color: var(--ink); }
.cat-item.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.cat-ico { width: 20px; text-align: center; flex: none; font-size: 13px; }
.cat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-item.active .cat-count { color: var(--brand); }

/* 网络环境提示（侧边栏底部） */
.net-strip { padding: 0 10px 2px; }
.net-strip:empty { display: none; }
.net-pill {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.net-pill i { width: 7px; height: 7px; border-radius: 50%; background: #b9b2a3; flex: none; }
.net-pill em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); }
.net-pill.ok { cursor: default; border-color: #cfe3d6; background: #f2f8f4; color: #2c6b4f; }
.net-pill.ok i { background: #3d9b6c; box-shadow: 0 0 0 3px rgba(61, 155, 108, 0.15); }
.net-pill.wan:hover { border-color: #d9c9a8; background: #fff; color: var(--ink); }
.net-pill.wan i { background: var(--gold); }

.sb-user {
  border-top: 1px solid var(--line-2);
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.sb-user .u-meta { min-width: 0; flex: 1; }
.sb-user .u-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user .u-role { font-size: 11px; color: var(--muted); }
.role-badge {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--brand-50);
  color: var(--brand);
  border: 1px solid #d7e5dc;
  letter-spacing: 0.3px;
}
.role-badge.admin { background: var(--gold-100); color: #8d6521; border-color: #ecd9b5; }

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

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  min-height: 62px;
}
.menu-btn { display: none; }
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: 0.4px; flex: none; }
.topbar-search {
  flex: 1;
  max-width: 460px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 12px;
  color: var(--muted);
  transition: all 0.16s;
}
.topbar-search:focus-within { background: #fff; border-color: #c9d6cd; box-shadow: 0 0 0 3px rgba(31, 74, 61, 0.06); }
.topbar-search input { border: none; background: transparent; outline: none; width: 100%; color: var(--ink); }
.topbar-search input::placeholder { color: #a7afa7; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.avatar-wrap { position: relative; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #d9e2da;
  background: linear-gradient(150deg, #e8efe9, #d5e2d9);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  display: grid; place-items: center;
  letter-spacing: 0.5px;
}
.avatar-menu {
  position: absolute; right: 0; top: 44px;
  width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
}
.am-head { padding: 9px 10px 11px; border-bottom: 1px solid var(--line-2); margin-bottom: 5px; }
.am-head strong { display: block; font-size: 13px; }
.am-head span { font-size: 11px; color: var(--muted); }
.avatar-menu button {
  display: block; width: 100%;
  border: none; background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px; color: var(--ink-2);
}
.avatar-menu button:hover { background: var(--surface-2); color: var(--ink); }

.view { padding: 22px 24px 60px; flex: 1; }

/* ---------------- 素材广场 ---------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 21px; letter-spacing: 0.4px; font-weight: 600; }
.page-head .desc { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.head-actions { display: flex; align-items: center; gap: 10px; }

.filter-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: none; background: transparent;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.15s;
}
.seg button.active { background: var(--brand); color: #fff; box-shadow: 0 1px 4px rgba(31, 74, 61, 0.2); }
.seg button:not(.active):hover { background: var(--surface-2); }

.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 7px 30px 7px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute; right: 12px;
  width: 6px; height: 6px;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  pointer-events: none;
}

.check-inline { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.check-inline input { accent-color: var(--brand); width: 15px; height: 15px; }

.result-meta { font-size: 12px; color: var(--muted); margin-left: auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s;
}
.card:hover { box-shadow: 0 10px 26px rgba(28, 42, 37, 0.1); transform: translateY(-2px); border-color: #ded7c6; }
.card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31, 74, 61, 0.16); }
.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f3f1e9, #e9e6db);
  overflow: hidden;
  display: grid; place-items: center;
}
.thumb img, .thumb video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.thumb .ph { display: grid; place-items: center; gap: 8px; color: #9aa39a; }
.thumb .ph .ext {
  font-size: 10.5px; letter-spacing: 1.4px;
  text-transform: uppercase;
  border: 1px solid #d8d3c4;
  padding: 2px 8px;
  border-radius: 20px;
  color: #8b8f83;
  background: rgba(255, 255, 255, 0.6);
}
.kind-tag {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(20, 32, 27, 0.68);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  letter-spacing: 0.3px;
}
.play-ring {
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.65);
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
  color: #fff;
}
.card-tools {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.16s;
}
.card:hover .card-tools { opacity: 1; transform: none; }
.tool-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: none;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-2);
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(20, 32, 27, 0.16);
}
.tool-btn:hover { background: #fff; color: var(--brand); }
.tool-btn.danger:hover { color: var(--danger); }
.sel-box {
  position: absolute; top: 8px; left: 8px;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d5cfc0;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.card:hover .sel-box, .card.selected .sel-box { opacity: 1; }
.sel-box.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.sel-box svg { display: none; }
.sel-box.on svg { display: block; }
.card-body { padding: 10px 12px 12px; }
.card-title {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-sub {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden;
}
.card-sub .dot { opacity: 0.5; }
.card-cat {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 10.5px;
  color: var(--ink-2);
}
.card-new {
  position: absolute; top: 8px; left: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(192, 138, 62, 0.18);
}

.empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty .em-ico { font-size: 34px; opacity: 0.5; margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.empty p { margin: 0 0 16px; font-size: 12.5px; }

.load-more { display: flex; justify-content: center; margin-top: 26px; }

.batch-bar {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 10px 12px 10px 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 16px 40px rgba(20, 32, 27, 0.3);
  z-index: 70;
  font-size: 13px;
}
.batch-bar .btn { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: transparent; }
.batch-bar .btn:hover { background: rgba(255, 255, 255, 0.2); }
.batch-bar .btn.danger { background: var(--danger); }
.batch-bar .btn.danger:hover { background: #a83f34; }

/* ---------------- 灯箱 ---------------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(16, 24, 21, 0.92);
  backdrop-filter: blur(6px);
  z-index: 90;
  display: flex; flex-direction: column;
  color: #e9efeb;
}
.lb-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  flex: none;
}
.lb-bar h3 { margin: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar .lb-meta { font-size: 11.5px; color: rgba(233, 239, 235, 0.55); white-space: nowrap; }
.lb-bar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lb-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e9efeb;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lb-btn.close { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 20px; }

.lb-body { flex: 1; display: flex; min-height: 0; }
.lb-stage {
  flex: 1; position: relative;
  display: grid; place-items: center;
  padding: 24px;
  min-width: 0;
}
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.lb-stage video { max-width: 100%; max-height: 100%; border-radius: 6px; background: #000; }
.lb-stage iframe { width: 100%; height: 100%; border: none; border-radius: 8px; background: #fff; }
.lb-no-preview {
  text-align: center; color: rgba(233, 239, 235, 0.65);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 50px 40px;
}
.lb-no-preview .em { font-size: 40px; opacity: 0.7; margin-bottom: 12px; }
.lb-nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: grid; place-items: center;
  font-size: 20px;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.18); }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }

.lb-side {
  width: 300px; flex: none;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  padding: 22px 22px 30px;
  overflow-y: auto;
  font-size: 12.5px;
}
.lb-side h4 { margin: 0 0 14px; font-size: 11px; letter-spacing: 1.2px; color: rgba(233, 239, 235, 0.45); font-weight: 500; }
.lb-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.lb-row .k { color: rgba(233, 239, 235, 0.5); width: 60px; flex: none; }
.lb-row .v { color: #e9efeb; word-break: break-all; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lb-tags span {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
}
.lb-desc { color: rgba(233, 239, 235, 0.75); line-height: 1.8; white-space: pre-wrap; margin: 10px 0 0; }
.lb-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 11px;
  line-height: 1.7;
  color: rgba(233, 239, 235, 0.45);
}

/* ---------------- 上传 ---------------- */
.upload-wrap { max-width: 980px; }
.dropzone {
  border: 1.5px dashed #cfc9b8;
  border-radius: 18px;
  background: var(--surface);
  padding: 42px 24px;
  text-align: center;
  transition: all 0.18s;
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--brand);
  background: var(--brand-50);
}
.dz-ico {
  width: 54px; height: 54px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: var(--brand-50);
  color: var(--brand);
  display: grid; place-items: center;
}
.dropzone h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.dropzone p { margin: 0; font-size: 12.5px; color: var(--muted); }
.dz-hint { margin-top: 14px; font-size: 11.5px; color: #a3aa9f; }

.queue { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.q-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
}
.q-thumb {
  width: 46px; height: 46px; border-radius: 8px;
  overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center;
  flex: none; font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.q-thumb img { width: 100%; height: 100%; object-fit: cover; }
.q-info { min-width: 0; flex: 1; }
.q-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-size { font-size: 11px; color: var(--muted); }
.q-remove { background: none; border: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 6px; }
.q-remove:hover { color: var(--danger); background: var(--danger-100); }

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-top: 16px;
}
.form-card > h3 { margin: 0 0 16px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.form-card > h3 .num {
  width: 20px; height: 20px; border-radius: 6px;
  background: var(--brand-50); color: var(--brand);
  font-size: 11px; display: grid; place-items: center;
}
.cat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.cat-opt {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: all 0.15s;
  text-align: left;
}
.cat-opt:hover { border-color: #cdc6b5; background: #fff; }
.cat-opt.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); font-weight: 600; box-shadow: 0 0 0 2px rgba(31, 74, 61, 0.07); }
.cat-opt .ico { font-size: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.form-actions .hint { font-size: 11.5px; color: var(--muted); margin-left: auto; }

.progress { height: 6px; background: var(--line-2); border-radius: 20px; overflow: hidden; margin-top: 14px; }
.up-prog-text { margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #4b8a71); border-radius: 20px; transition: width 0.2s; }

.result-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 24px;
  text-align: center;
}
.result-box .ok-ring {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand);
  display: grid; place-items: center; margin: 0 auto 14px;
}
.result-box h3 { margin: 0 0 6px; font-size: 17px; }
.result-box p { margin: 0 0 20px; color: var(--muted); font-size: 12.5px; }

/* ---------------- 管理后台 ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs button {
  border: none; background: none;
  padding: 10px 15px;
  font-size: 13.5px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
}
.stat-card .k { font-size: 11.5px; color: var(--muted); letter-spacing: 0.4px; }
.stat-card .v { font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.stat-card .v small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.stat-card .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
  gap: 12px;
}
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-head .sub { font-size: 11.5px; color: var(--muted); margin-left: 8px; font-weight: 400; }
.panel-body { padding: 16px 18px; }
.panel-body.flush { padding: 0; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fcfbf7; }
.tbl .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl .muted { color: var(--muted); font-size: 12px; }
.tag-pill {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: 11px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--ink-2);
}
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #57a06f; }
.status-dot.off::before { background: #b9bdb7; }
.status-dot.off { color: var(--muted); }

.cat-manage-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-2);
}
.cat-manage-row:last-child { border-bottom: none; }
.cat-manage-row .ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-2);
  font-size: 16px;
  flex: none;
}
.cat-manage-row .nm { font-size: 13.5px; font-weight: 500; }
.cat-manage-row .ds { font-size: 11.5px; color: var(--muted); }
.cat-manage-row .cnt { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-manage-row .ops { display: flex; gap: 4px; }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(20, 30, 26, 0.45);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.18s ease;
  max-height: 90vh;
  display: flex; flex-direction: column;
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-2);
  background: var(--surface-2);
}
.modal-close { background: none; border: none; font-size: 22px; color: var(--muted); line-height: 1; padding: 0 4px; }

/* ---------------- Toast ---------------- */
.toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 32, 27, 0.25);
  animation: toastIn 0.2s ease;
  max-width: 80vw;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--brand); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; }
  .login-brand { display: none; }
  .login-form-wrap { padding: 34px 28px; }
  .pc-only { display: none; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
    width: 264px;
  }
  .sidebar.open { transform: none; }
  .sb-close { display: block; }
  .menu-btn { display: inline-flex; }
  .sb-mask { position: fixed; inset: 0; background: rgba(20,30,26,.35); z-index: 25; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar-title { display: none; }
  .topbar-actions .btn span { display: none; }
  .view { padding: 16px 14px 70px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .lb-side { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------------- 账号管理：内联表单 ---------------- */
.user-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.user-form .field { margin-bottom: 0; }
.user-form .field > span { font-size: 11.5px; color: var(--muted); }
.user-form .btns { display: flex; gap: 8px; }

.form-tip { font-size: 11.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.batch-toggle {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 12.5px;
  padding: 0;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.batch-toggle:hover { text-decoration: underline; }
.batch-area { margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line); }
.batch-area textarea {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  resize: vertical;
  outline: none;
  line-height: 1.7;
}
.batch-area textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(31, 74, 61, 0.08); }
.batch-foot { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.batch-foot .field { margin-bottom: 0; width: 170px; }

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.list-toolbar input {
  width: 240px;
  max-width: 50%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 11px;
  background: #fff;
  outline: none;
  font-size: 12.5px;
}
.list-toolbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 74, 61, 0.07); }
.list-toolbar .count { margin-left: auto; font-size: 12px; color: var(--muted); }

.tbl tr.editing td { background: #fbfaf6; }
.tbl tr.fresh td { animation: rowflash 1.8s ease; }
@keyframes rowflash { 0% { background: #eaf3de; } 100% { background: transparent; } }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-edit-grid { display: grid; gap: 6px; }
.row-edit-grid .sub-line { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.row-edit-grid .sub-line input { flex: 1; }
.tbl td input[type="text"],
.tbl td select {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 12.5px;
  background: #fff;
  outline: none;
  width: 100%;
  min-width: 88px;
}
.tbl td input[type="text"]:focus,
.tbl td select:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(31, 74, 61, 0.08); }

@media (max-width: 1100px) {
  .user-form { grid-template-columns: 1fr 1fr; }
  .user-form .btns { grid-column: 1 / -1; }
}
