:root {
  --accent: #ff3b5c;
  --accent-deep: #e62e4e;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #222327;
  --text-2: #7b8087;
  --line: #e8eaee;
  --dark: #191b1f;
  --dark-2: #26282e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 6px 18px rgba(0,0,0,.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }

/* ===================== 欢迎页 ===================== */
.landing {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; height: 100dvh;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,59,92,.10) 0%, transparent 35%),
    radial-gradient(circle at 80% 70%, rgba(59,130,246,.10) 0%, transparent 40%),
    linear-gradient(160deg, #0c0d10 0%, #15171b 50%, #0f1013 100%);
  overflow: hidden;
  transition: opacity .8s ease, transform .8s ease, visibility .8s;
}
.landing.exited {
  opacity: 0; transform: scale(1.04); visibility: hidden; pointer-events: none;
}

.landing-bg {
  position: absolute; inset: -10%;
  color: rgba(255,255,255,.18);
  pointer-events: none;
  animation: bgDrift 60s linear infinite;
}
.landing-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 25%, rgba(12,13,16,.9) 85%);
}
.landing-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 35% 35%, rgba(255,59,92,.08) 0%, transparent 45%),
              radial-gradient(circle at 70% 75%, rgba(59,130,246,.08) 0%, transparent 45%);
}

.gear {
  position: absolute;
  opacity: .75;
  filter: drop-shadow(0 0 24px rgba(255,255,255,.12));
}
.gear-1 { width: 260px; top: 8%; left: 6%; animation: float 9s ease-in-out infinite; }
.gear-2 { width: 180px; top: 12%; right: 10%; animation: float 11s ease-in-out infinite 1s; }
.gear-3 { width: 320px; bottom: 10%; left: 3%; animation: float 12s ease-in-out infinite 2s; }
.gear-4 { width: 220px; bottom: 18%; right: 5%; animation: float 10s ease-in-out infinite .5s; }
.gear-5 { width: 160px; top: 55%; left: 22%; animation: float 13s ease-in-out infinite 1.5s; }
.gear-6 { width: 200px; top: 65%; right: 22%; animation: float 9.5s ease-in-out infinite .8s; }

.landing-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}

.landing-content {
  position: relative; z-index: 2;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px;
  max-width: 720px;
  animation: contentIn 1.2s cubic-bezier(.22,.61,.36,1) both;
}

.logo-glow {
  position: relative;
  padding: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  animation: logoFloat 5s ease-in-out infinite;
}
.logo-glow::before {
  content: ''; position: absolute; inset: -20%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(255,59,92,.25), transparent, rgba(59,130,246,.18), transparent);
  filter: blur(24px);
  animation: rotate 10s linear infinite;
  opacity: .7;
}
.landing-logo {
  position: relative; z-index: 1;
  width: min(520px, 78vw);
  height: auto;
  max-height: 34vh;
  object-fit: contain;
  filter: drop-shadow(0 10px 40px rgba(0,0,0,.45));
  transition: transform .6s ease;
}
.logo-glow:hover .landing-logo { transform: scale(1.03); }

.landing-sub {
  margin-top: 18px;
  color: rgba(255,255,255,.55);
  font-size: clamp(13px, 2vw, 16px);
  letter-spacing: 6px;
  text-transform: uppercase;
  animation: fadeInUp 1s .6s both;
}

.slide-entry {
  margin-top: 42px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: fadeInUp 1s .9s both;
}
.slide-track {
  position: relative;
  width: min(320px, 78vw); height: 56px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 4px rgba(0,0,0,.25), 0 0 0 1px rgba(255,255,255,.04), 0 12px 40px rgba(0,0,0,.35);
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.slide-hint {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.60);
  font-size: 14px; letter-spacing: 2px;
  pointer-events: none;
  transition: opacity .25s;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.slide-hint .arrow { margin-right: 8px; animation: arrowPulse 1.4s ease-in-out infinite; }
.slide-thumb {
  position: absolute; top: 5px; left: 5px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px rgba(255,59,92,.18), 0 6px 22px rgba(255,59,92,.55);
  cursor: grab;
  transform: translateX(0);
  transition: transform .1s linear, box-shadow .2s;
  will-change: transform;
  animation: thumbPulse 2.2s ease-in-out infinite;
}
.slide-thumb:active { cursor: grabbing; box-shadow: 0 0 0 6px rgba(255,59,92,.25), 0 8px 28px rgba(255,59,92,.75); }
@keyframes thumbPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(255,59,92,.15), 0 6px 22px rgba(255,59,92,.55); } 50% { box-shadow: 0 0 0 8px rgba(255,59,92,.06), 0 8px 28px rgba(255,59,92,.7); } }
.slide-thumb.unlocked {
  transition: transform .35s cubic-bezier(.22,.61,.36,1), opacity .35s;
}
.slide-fallback {
  background: none; border: none;
  color: rgba(255,255,255,.35);
  font-size: 12px; letter-spacing: 1px;
  cursor: pointer;
  padding: 6px 12px;
  transition: color .2s;
}
.slide-fallback:hover { color: rgba(255,255,255,.75); }

.landing-footer {
  position: absolute; bottom: 24px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,.22);
  font-size: 11px; letter-spacing: 1px;
}

@keyframes bgDrift { from { transform: translateX(0) rotate(0deg); } to { transform: translateX(-4%) rotate(2deg); } }
@keyframes float { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-16px) rotate(3deg); } }
@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes contentIn { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes arrowPulse { 0%,100% { transform: translateX(0); opacity: .6; } 50% { transform: translateX(6px); opacity: 1; } }
@keyframes logoFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 640px) {
  .landing-content { padding: 18px; transform: translateY(-4vh); }
  .landing-logo { width: 84vw; max-height: 20vh; }
  .logo-glow { padding: 18px; }
  .landing-sub { letter-spacing: 3px; font-size: 12px; margin-top: 10px; }
  .slide-entry { margin-top: 28px; }
  .slide-track { width: min(300px, 82vw); height: 52px; }
  .slide-thumb { width: 40px; height: 40px; }
  .gear-1 { width: 160px; top: 5%; left: -8%; }
  .gear-2 { width: 110px; top: 10%; right: -5%; }
  .gear-3 { width: 190px; bottom: 8%; left: -12%; }
  .gear-4 { width: 130px; bottom: 20%; right: -8%; }
  .gear-5 { width: 90px; top: 60%; left: 8%; }
  .gear-6 { width: 120px; top: 68%; right: 6%; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { display: block; }

/* ---------- 顶部导航 ---------- */
.topbar {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img {
  height: 44px; width: auto; min-width: 70px;
  object-fit: contain; display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
  transition: opacity .2s;
}
.logo:hover .logo-img { opacity: .85; }

.nav-tabs { display: flex; gap: 6px; flex: 1; }
.nav-tabs a {
  color: #b7bcc4; font-size: 15px; padding: 7px 14px;
  border-radius: 18px; transition: all .18s;
}
.nav-tabs a:hover { color: #fff; }
.nav-tabs a.active { color: #fff; background: var(--dark-2); }

.topbar-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.search-box {
  display: flex; align-items: center; gap: 7px;
  background: var(--dark-2);
  border-radius: 18px; padding: 0 14px; height: 36px;
  color: #8b9099; transition: all .18s;
  border: 1px solid transparent;
}
.search-box:focus-within { border-color: #3a3d44; color: #c9ced6; }
.search-box input {
  background: none; border: none; outline: none;
  color: #e8eaee; font-size: 13px; width: 170px;
}
.search-box input::placeholder { color: #6d727b; }

/* ---------- 用户区 / 登录 ---------- */
.user-area { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 7px;
  color: #c9ced6; font-size: 13.5px;
  padding: 0 10px 0 4px; height: 36px;
  background: none; border: none; cursor: pointer; font-family: inherit;
  border-radius: 18px; transition: background .18s;
}
.user-chip:hover { background: rgba(255,255,255,.08); }
.user-chip .chip-name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.user-chip .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip .role-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 4px;
  background: rgba(255,59,92,.18); color: #ff7d95;
}
/* 个人资料弹窗 */
.profile-modal {
  width: min(400px, 92vw); background: #fff; border-radius: 20px;
  overflow: hidden; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.profile-hero {
  padding: 34px 34px 22px; text-align: center;
  background: linear-gradient(135deg, #232632, #2e3240);
}
.profile-avatar {
  width: 92px; height: 92px; border-radius: 50%;
  margin: 0 auto 12px; overflow: hidden; cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #22d3ee);
  color: #fff; font-size: 36px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid rgba(255,255,255,.35);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  transition: transform .18s, border-color .18s;
}
.profile-avatar:hover { transform: scale(1.05); border-color: rgba(255,255,255,.7); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-tip { font-size: 12.5px; color: #9aa0a8; }
.profile-form { padding: 22px 34px 30px; }
.profile-form .hint-inline { color: #a7acb3; font-weight: 400; font-size: 12px; }
.profile-form input:disabled { cursor: not-allowed; }
.btn-ghost {
  background: none; border: 1px solid #3a3d44; cursor: pointer;
  color: #c9ced6; font-size: 13.5px; font-family: inherit;
  height: 36px; padding: 0 15px; border-radius: 18px;
  transition: all .18s; white-space: nowrap;
}
.btn-ghost:hover { border-color: #565a63; color: #fff; }

/* 登录弹窗 */
/* 弹窗容器中和：登录/用户管理这类小卡片不需要 960px 白底容器 */
.modal:has(> .auth-modal), .modal:has(> .user-modal), .modal:has(> .edit-modal), .modal:has(> .profile-modal) {
  width: auto; max-height: none; background: none; overflow: visible;
  animation: pop .28s ease;
}
.auth-modal {
  width: min(400px, 92vw); background: #fff; border-radius: 20px;
  overflow: hidden; position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.auth-close { top: 14px; right: 14px; background: rgba(255,255,255,.22); }
.auth-close:hover { background: rgba(255,255,255,.4); }
.auth-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #ff6045);
  padding: 34px 34px 28px; color: #fff;
}
.auth-hero::after {
  content: ''; position: absolute; right: -34px; top: -34px;
  width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.auth-hero::before {
  content: ''; position: absolute; right: 52px; bottom: -48px;
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.auth-badge {
  width: 46px; height: 46px; border-radius: 14px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; position: relative; z-index: 1;
}
.auth-hero h3 { font-size: 22px; margin-bottom: 6px; position: relative; z-index: 1; }
.auth-hero p { font-size: 13px; color: rgba(255,255,255,.88); position: relative; z-index: 1; }
.auth-form { padding: 22px 34px 30px; }
.auth-tabs {
  display: flex; border-bottom: 1px solid var(--line);
  padding: 0 34px; gap: 4px; background: #fff;
}
.auth-tab {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 14.5px; font-weight: 600; color: #9aa0a8;
  padding: 13px 2px 11px; margin-right: 22px; position: relative;
  transition: color .15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.on { color: var(--text); }
.auth-tab.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2.5px; border-radius: 2px; background: var(--accent);
}
.code-wrap input { padding-right: 118px; }
.send-code {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  height: 34px; padding: 0 12px; border: none; border-radius: 9px;
  background: #fff0f3; color: var(--accent); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s;
}
.send-code:hover { background: #ffe0e7; }
.send-code:disabled { color: #a7acb3; background: #f1f3f5; cursor: not-allowed; }
.sms-hint { font-size: 12px; color: #a7acb3; margin: -4px 2px 4px; }
.input-wrap { position: relative; margin-bottom: 14px; }
.input-wrap input {
  width: 100%; height: 48px; box-sizing: border-box;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 0 46px; font-size: 14.5px; font-family: inherit;
  outline: none; background: #fafbfc; color: var(--text);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input-wrap input::placeholder { color: #b6bbc2; }
.input-wrap input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(255,59,92,.09);
}
.input-wrap .ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: #a7acb3; pointer-events: none; transition: color .18s;
}
.input-wrap input:focus + .ic { color: var(--accent); }
.input-wrap .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; background: none; cursor: pointer;
  color: #a7acb3; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: color .15s;
}
.input-wrap .eye:hover { color: #565a63; }
.auth-modal .err-tip {
  color: #c73a4e; font-size: 13px; min-height: 20px;
  margin: 0 0 12px; display: flex; align-items: center; gap: 6px;
}
.auth-modal .err-tip:empty { display: none; }
.auth-modal .err-tip.shake { animation: shake .32s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.auth-modal .btn-primary { height: 48px; border-radius: 12px; margin-top: 2px; }
.auth-foot {
  margin-top: 18px; text-align: center; font-size: 12.5px; color: #a7acb3;
}
@media (max-width: 480px) {
  .auth-hero { padding: 26px 24px 22px; }
  .auth-form { padding: 22px 24px 26px; }
}

/* 用户管理弹窗 */
.user-modal { width: min(520px, 94vw); background: #fff; border-radius: 16px; padding: 30px 32px; position: relative; max-height: 84vh; overflow-y: auto; }
.user-modal h3 { font-size: 20px; margin-bottom: 18px; }
.user-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.user-row:last-of-type { border-bottom: none; }
.user-row .name { font-weight: 600; flex: 1; }
.user-row .role { font-size: 12px; padding: 2px 9px; border-radius: 4px; }
.user-row .role.admin { background: #fff0f3; color: var(--accent); }
.user-row .role.user { background: #eef4ff; color: #3b82f6; }
.user-modal .add-form {
  display: flex; gap: 8px; margin: 18px 0 6px; flex-wrap: wrap;
}
.user-modal .add-form input {
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; outline: none; font-family: inherit;
  min-width: 0;
}
.user-modal .add-form input:focus { border-color: var(--accent); }
.user-modal .add-form input.u-name { flex: 1; }
.user-modal .add-form input.u-pass { flex: 1; }
.btn-mini {
  border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600;
  padding: 7px 14px; border-radius: 8px; background: var(--accent); color: #fff;
  transition: filter .15s; white-space: nowrap;
}
.btn-mini:hover { filter: brightness(1.08); }
.btn-mini.gray { background: #eef0f3; color: #565a63; }
.btn-mini.danger { background: none; color: #c73a4e; padding: 7px 8px; }
.btn-mini.danger:hover { background: #fff0f3; }

/* ---------- 管理后台 ---------- */
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.admin-head h2 { font-size: 22px; }
.admin-head-actions { display: flex; gap: 8px; }
.admin-head-actions .btn-mini { text-decoration: none; padding: 9px 16px; }
.admin-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card .num { font-size: 24px; font-weight: 700; }
.stat-card .lab { font-size: 12.5px; color: var(--text-2); }
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.admin-tab {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 15px; font-weight: 600; color: #9aa0a8; padding: 10px 4px 12px; margin-right: 24px;
  position: relative; transition: color .15s;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.on { color: var(--text); }
.admin-tab.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2.5px; border-radius: 2px; background: var(--accent);
}
.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px; flex-wrap: wrap;
}
.admin-filter { display: flex; gap: 6px; }
.admin-filter-btn {
  border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 15px; border-radius: 18px; background: #f1f3f5; color: #565a63;
  transition: all .15s;
}
.admin-filter-btn:hover { background: #e7eaee; }
.admin-filter-btn.on { background: var(--accent); color: #fff; }
.admin-search { background: #fff; }
.admin-table-wrap {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-x: auto;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 760px; }
.admin-table th {
  text-align: left; padding: 12px 14px; font-size: 12px; color: var(--text-2);
  border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap;
  background: #fafbfc;
}
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-thumb {
  width: 58px; aspect-ratio: 16/9; border-radius: 6px; object-fit: cover;
  display: flex; align-items: center; justify-content: center; background: #17181c;
  color: #9aa0a8; font-size: 12px;
}
.admin-thumb.placeholder { background: #eef0f3; color: #a7acb3; }
.admin-table .t-title {
  font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-table .ops { white-space: nowrap; }
.admin-table .ops .btn-mini { margin-right: 2px; }
.admin-table .empty-cell { text-align: center; color: var(--text-2); padding: 34px 0; }
.type-tag { font-size: 11.5px; padding: 2px 9px; border-radius: 5px; font-weight: 600; }
.type-tag.video { background: #fff0f3; color: var(--accent); }
.type-tag.image { background: #eef4ff; color: #3b82f6; }
.type-tag.text { background: #f0f9f1; color: #2f9e44; }
.cat-tag { font-size: 11.5px; padding: 2px 9px; border-radius: 5px; font-weight: 600; background: #f4f0fa; color: #7c3aed; white-space: nowrap; }
.u-name-cell { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.u-name-cell .uname-sub { font-style: normal; font-weight: 400; font-size: 12px; color: #a7acb3; margin-left: 6px; }
.role { font-size: 12px; padding: 2px 9px; border-radius: 4px; font-weight: 600; }
.role.admin { background: #fff0f3; color: var(--accent); }
.role.user { background: #eef4ff; color: #3b82f6; }
.self-tag { font-size: 12px; color: #a7acb3; padding: 0 6px; }
.admin-add-user {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-top: 16px;
}
.admin-add-user h4 { font-size: 15px; margin-bottom: 12px; }
.admin-add-form { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-add-form input, .admin-add-form select {
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px; outline: none; font-family: inherit; min-width: 0;
}
.admin-add-form input:focus { border-color: var(--accent); }
.admin-add-form input#newUserName { flex: 1.2; }
.admin-add-form input#newUserPass { flex: 1.2; }
.edit-modal {
  width: min(520px, 94vw); background: #fff; border-radius: 16px;
  padding: 28px 32px 30px; position: relative; max-height: 86vh; overflow-y: auto;
}
.edit-modal h3 { font-size: 20px; margin-bottom: 20px; }
@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
}

/* 详情弹窗操作区 */
.modal-meta .act-group { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.modal-share {
  border: none; cursor: pointer; font-family: inherit;
  background: none; color: #b0b5bc; font-size: 12.5px; padding: 3px 8px;
  border-radius: 6px; transition: all .15s;
}
.modal-share:hover { color: #3b82f6; background: #eef4ff; }
.modal-del:hover { color: var(--accent); background: #fff0f3; }

.btn-upload {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--accent), #ff6045);
  color: #fff; font-size: 14px; font-weight: 600;
  height: 36px; padding: 0 18px; border-radius: 18px;
  transition: all .18s;
}
.btn-upload:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255,59,92,.4); }

/* ---------- 首页 ---------- */
main { flex: 1; }
.page {
  max-width: 1400px; margin: 0 auto; padding: 20px 24px 40px;
  width: 100%;
}
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.page-head h2 { font-size: 20px; }
.page-head .count { color: var(--text-2); font-size: 13px; }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1200px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid { grid-template-columns: 1fr; } }

/* ---------- 主轮播图 ---------- */
.carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 21 / 7.5;
  width: 100%;
  margin-inline: auto;
  background: #17181c;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  margin-bottom: 22px;
}
@media (max-width: 900px) { .carousel { aspect-ratio: 16 / 9; } }

.slide {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
  cursor: pointer;
}
.slide.on { opacity: 1; pointer-events: auto; }
.slide img, .slide .slide-ph {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02); transition: transform 6s linear;
}
.slide.on img { transform: scale(1.08); }
.slide-ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b2e36, #43464f);
}

/* 底部渐变浮层 */
.slide-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,11,14,.86) 0%, rgba(10,11,14,.35) 38%, rgba(10,11,14,0) 68%);
}
.slide-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  color: #fff;
  padding: 30px 14px 26px;
}
.slide-title {
  font-size: clamp(20px, 2.6vw, 32px); font-weight: 700;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
  max-width: 620px; line-height: 1.3;
}
.slide-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; font-size: 13.5px; color: rgba(255,255,255,.82);
}
.slide-meta .tag {
  background: var(--accent); font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 4px; color: #fff;
}
.slide-meta .dot { width: 3px; height: 3px; background: rgba(255,255,255,.5); border-radius: 50%; }
.slide-cta {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff; font-size: 14.5px; font-weight: 600;
  padding: 11px 22px; border-radius: 24px;
  transition: all .2s;
}
.slide-cta .circle {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.slide:hover .slide-cta { background: var(--accent); border-color: var(--accent); }
@media (max-width: 700px) { .slide-info { padding: 18px 14px 18px; } .slide-cta { display: none; } .car-dots { right: 14px; bottom: 12px; } }

/* 箭头 */
.car-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(15,16,20,.42); color: #fff; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); opacity: 0; transition: all .22s;
}
.carousel:hover .car-arrow { opacity: 1; }
.car-arrow:hover { background: var(--accent); }
.car-arrow.prev { left: 16px; }
.car-arrow.next { right: 16px; }
@media (max-width: 700px) { .car-arrow { width: 34px; height: 34px; } }

/* 指示点（带进度动画） */
.car-dots {
  position: absolute; right: 14px; bottom: 18px; z-index: 6;
  display: flex; gap: 8px; align-items: center;
}
.car-dot {
  width: 26px; height: 4px; border-radius: 2px; border: none; cursor: pointer;
  background: rgba(255,255,255,.32); overflow: hidden; padding: 0;
  transition: width .2s;
}
.car-dot.on { width: 44px; background: rgba(255,255,255,.28); }
.car-dot.on::after {
  content: ""; display: block; height: 100%; width: 0;
  background: var(--accent);
  animation: dotbar 5.5s linear forwards;
}
.car-dot.on.paused::after { animation-play-state: paused; }
@keyframes dotbar { from { width: 0; } to { width: 100%; } }

/* 卡片 */
.card {
  background: var(--card); border-radius: 12px;
  overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .22s, box-shadow .22s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 4px 10px rgba(0,0,0,.07), 0 14px 30px rgba(0,0,0,.1); }

.card-cover {
  position: relative; aspect-ratio: 16/9; overflow: hidden;
  background: #17181c;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-cover img { transform: scale(1.05); }

.cover-ph {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2b2e36, #43464f);
}
.cover-ph svg { opacity: .5; }

/* 文字类卡片封面 */
.cover-text {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 18px 20px; gap: 8px;
  background: linear-gradient(135deg, #ff5c76, #ff8a4b);
  transition: filter .3s;
}
.card:hover .cover-text { filter: brightness(1.08); }
.cover-text .big {
  color: rgba(255,255,255,.95); font-size: 26px; font-weight: 700;
  line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cover-text .quote { color: rgba(255,255,255,.55); font-size: 30px; font-family: Georgia, serif; line-height: .6; }

.badge-duration {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,.72); color: #fff;
  font-size: 12px; padding: 2px 7px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.badge-type {
  position: absolute; left: 8px; top: 8px;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  color: #fff; backdrop-filter: blur(4px);
  display: flex; align-items: center; gap: 4px;
}
.badge-type.video { background: rgba(255,59,92,.88); }
.badge-type.image { background: rgba(45,140,255,.85); }
.badge-type.text  { background: rgba(255,150,50,.88); }
.badge-cat {
  position: absolute; right: 8px; top: 8px;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  color: #fff; backdrop-filter: blur(4px);
  background: rgba(20,22,26,.68);
}

.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.25); opacity: 0; transition: opacity .25s;
}
.card:hover .play-overlay { opacity: 1; }
.play-overlay .circle {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255,59,92,.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}

.card-body { padding: 12px 14px 14px; }
.card-title {
  font-size: 15px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em;
}
.card-meta {
  margin-top: 9px; display: flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 12.5px;
}
.card-meta .dot { width: 2px; height: 2px; background: #c3c7cd; border-radius: 50%; }
.card-meta svg { flex-shrink: 0; }

/* 空状态 / 加载 */
.state-block {
  grid-column: 1 / -1; text-align: center; padding: 90px 0; color: var(--text-2);
}
.state-block .icon { font-size: 44px; margin-bottom: 14px; }
.state-block p { font-size: 14px; }
.state-block a { color: var(--accent); font-weight: 600; }

/* ---------- 上传页 ---------- */
.upload-wrap { max-width: 720px; margin: 32px auto 60px; padding: 0 24px; }
.upload-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 32px 36px 36px;
}
.upload-card h2 { font-size: 22px; margin-bottom: 6px; }
.upload-card .sub { color: var(--text-2); font-size: 13.5px; margin-bottom: 26px; }

.seg { display: flex; gap: 10px; margin-bottom: 24px; }
.seg.seg-cat { margin-bottom: 0; }
.seg.seg-cat button { height: 58px; }
.seg button {
  flex: 1; height: 64px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fafbfc; cursor: pointer; transition: all .18s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.seg button svg { opacity: .75; }
.seg button.on {
  border-color: var(--accent); color: var(--accent); background: #fff5f7;
  box-shadow: 0 0 0 3px rgba(255,59,92,.1);
}

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.field label .req { color: var(--accent); margin-left: 2px; }
.field input[type=text], .field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .18s, box-shadow .18s;
  background: #fafbfc; resize: vertical;
}
.field input:focus, .field textarea:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(255,59,92,.09);
}

.dropzone {
  border: 2px dashed #d5d9df; border-radius: 12px;
  padding: 42px 20px; text-align: center; cursor: pointer;
  color: var(--text-2); transition: all .18s; background: #fafbfc;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent); background: #fff5f7; color: var(--accent);
}
.dropzone .icon { font-size: 36px; margin-bottom: 10px; }
.dropzone strong { color: inherit; }
.dropzone .hint { font-size: 12px; margin-top: 8px; color: #a7acb3; }

.dz-preview { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.dz-preview .thumb {
  width: 150px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden;
  background: #17181c; flex-shrink: 0;
}
.dz-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dz-preview .info { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); }
.dz-preview .info .name { font-weight: 600; color: var(--text); word-break: break-all; }
.dz-preview .info .row { margin-top: 4px; display: flex; gap: 12px; flex-wrap: wrap; }
.link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 0; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

.submit-bar { margin-top: 26px; }
.btn-primary {
  width: 100%; height: 48px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ff6045);
  color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all .18s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(255,59,92,.35); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; filter: none; box-shadow: none; }

.progress {
  height: 6px; background: #eef0f3; border-radius: 3px;
  margin-top: 14px; overflow: hidden; display: none;
}
.progress.on { display: block; }
.progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), #ff8a4b);
  border-radius: 3px; transition: width .2s;
}
.progress-label { font-size: 12.5px; color: var(--text-2); margin-top: 7px; text-align: center; }

/* ---------- 详情弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12,13,16,.82);
  z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 30px;
  backdrop-filter: blur(4px);
}
.modal-mask.on { display: flex; }
.modal {
  background: #fff; border-radius: 14px; overflow: hidden;
  width: min(960px, 100%); max-height: calc(100vh - 60px);
  display: flex; flex-direction: column; position: relative;
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-media { background: #0e0f12; }
.modal-media video, .modal-media img {
  width: 100%; max-height: 62vh; object-fit: contain; display: block;
}
/* 无法在线预览的文件（文档等）：下载兜底块 */
.media-fallback {
  min-height: 300px; padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: #c9ced6; text-align: center;
}
.media-fallback .fb-icon { font-size: 44px; }
.media-fallback .fb-title { font-size: 16px; font-weight: 600; color: #e8eaee; max-width: 480px; }
.media-fallback .fb-sub { font-size: 13px; color: #8b9099; }
.fb-download {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--accent), #ff6045);
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 10px 26px; border-radius: 22px; transition: filter .18s;
}
.fb-download:hover { filter: brightness(1.08); }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 17px;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.modal-close:hover { background: rgba(0,0,0,.8); }

.modal-body { padding: 22px 26px 26px; overflow-y: auto; }
.modal-body h3 { font-size: 20px; line-height: 1.4; margin-bottom: 10px; }
.modal-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--text-2); font-size: 13px; padding-bottom: 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.modal-meta .tag {
  color: var(--accent); background: #fff0f3; font-size: 12px;
  padding: 2px 9px; border-radius: 4px; font-weight: 600;
}
.modal-meta .tag.cat {
  color: #4b5563; background: #eef1f5;
}
.modal-desc { font-size: 14.5px; color: #4a4e55; line-height: 1.75; white-space: pre-wrap; }

/* 文字作品正文 */
.article { font-size: 15.5px; line-height: 1.9; color: #33363c; }
.article p { margin-bottom: 1em; }
.modal-media .article-hero {
  padding: 46px 40px; color: #fff;
  background: linear-gradient(135deg, #ff5c76, #ff8a4b);
}
.article-hero .t { font-size: 24px; font-weight: 700; line-height: 1.4; }
.article-hero .q { font-size: 40px; font-family: Georgia, serif; opacity: .5; line-height: .5; margin-bottom: 6px; }

.modal-del {
  margin-left: auto; border: none; cursor: pointer; font-family: inherit;
  background: none; color: #b0b5bc; font-size: 12.5px; padding: 3px 8px;
  border-radius: 6px; transition: all .15s;
}
.modal-del:hover { color: var(--accent); background: #fff0f3; }

/* ---------- Toast / Footer ---------- */
.toast {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: var(--dark); color: #fff; font-size: 14px;
  padding: 11px 22px; border-radius: 10px; z-index: 300;
  opacity: 0; pointer-events: none; transition: all .3s;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #d9364e; }

.footer {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  text-align: center; color: #a7acb3; font-size: 12.5px;
  padding: 26px 0 30px;
}
.back-welcome {
  color: var(--text-2); text-decoration: none;
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  transition: all .2s;
}
.back-welcome:hover { color: var(--accent); border-color: var(--accent); }

/* ===================== 响应式适配（平板 / 手机） ===================== */

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .page { padding: 18px 18px 36px; }
}

/* ---------- 手机 / 窄屏（≤760px）：顶栏两行 + 各区域压缩 ---------- */
@media (max-width: 760px) {
  /* 顶栏：第一行 logo + 搜索 + 用户区，第二行导航横向滚动 */
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 14px 8px; gap: 8px 10px; }
  .logo-img { height: 34px; min-width: 54px; }
  .topbar-right { margin-left: auto; gap: 8px; flex: 1; min-width: 0; justify-content: flex-end; }
  .search-box { height: 34px; padding: 0 10px; flex: 0 1 150px; min-width: 0; }
  .search-box input { width: 100%; font-size: 12.5px; }
  .btn-upload { height: 34px; padding: 0 13px; font-size: 13px; }
  .user-chip { height: 34px; }
  .user-chip .chip-name { max-width: 88px; }
  .nav-tabs {
    order: 5; flex: 1 1 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 4px; padding-bottom: 2px;
  }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs a { font-size: 13.5px; padding: 6px 12px; white-space: nowrap; }

  /* 主内容 */
  .page { padding: 14px 14px 32px; }
  .page-head { flex-wrap: wrap; gap: 4px 10px; }
  .page-head h2 { font-size: 18px; }
  .grid { gap: 14px; }
  .card-body { padding: 10px 12px 12px; }
  .card-title { font-size: 14px; }
  .cover-text .big { font-size: 21px; }
  .cover-text .quote { font-size: 24px; }

  /* 轮播 */
  .carousel { aspect-ratio: 16 / 10; border-radius: 10px; margin-bottom: 16px; }
  .slide-info { padding: 16px 12px 14px; }
  .slide-title { font-size: 18px; max-width: 100%; }
  .slide-meta { font-size: 12px; margin-top: 8px; gap: 7px; }
  .car-arrow { opacity: .82; width: 34px; height: 34px; }
  .car-dots { right: 12px; bottom: 10px; }

  /* 详情弹窗 */
  .modal-mask { padding: 10px; }
  .modal { max-height: calc(100dvh - 20px); border-radius: 12px; }
  .modal-media video, .modal-media img { max-height: 44vh; }
  .modal-body { padding: 16px 16px 20px; }
  .modal-body h3 { font-size: 17px; }
  .article { font-size: 14.5px; }
  .article-hero { padding: 28px 20px; }
  .article-hero .t { font-size: 19px; }
  .article-hero .q { font-size: 30px; }

  /* 上传页 */
  .upload-wrap { margin: 16px auto 40px; padding: 0; }
  .upload-card { padding: 22px 18px 26px; border-radius: 14px; }
  .seg button { height: auto; min-height: 54px; padding: 8px 4px; font-size: 13px; }
  .seg.seg-cat { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .seg.seg-cat button { height: 50px; }
  .dropzone { padding: 30px 16px; }
  .dz-preview .thumb { width: 118px; }

  /* 管理后台 */
  .admin-head { flex-wrap: wrap; gap: 10px; }
  .admin-head h2 { font-size: 19px; }
  .admin-tabs { overflow-x: auto; scrollbar-width: none; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { margin-right: 16px; white-space: nowrap; }
  .admin-filter { flex-wrap: wrap; }

  /* 提示条避开更高的两行顶栏 */
  .toast { top: 106px; max-width: calc(100vw - 28px); }
}

/* ---------- 小屏手机（≤480px） ---------- */
@media (max-width: 480px) {
  .page { padding: 12px 12px 28px; }
  .grid { gap: 12px; }
  .carousel { aspect-ratio: 16 / 11; }
  .btn-upload .t { display: none; }
  .btn-upload { padding: 0 11px; }
  .search-box { flex: 0 1 120px; }
  .user-chip .chip-name { max-width: 64px; }
  .cover-text .big { font-size: 19px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .num { font-size: 20px; }
  .user-modal { padding: 22px 18px; }
  .edit-modal { padding: 22px 18px 24px; }
  .profile-hero { padding: 26px 20px 18px; }
  .profile-form { padding: 18px 20px 24px; }
  .footer { flex-wrap: wrap; gap: 8px; padding: 20px 14px 24px; }
}

/* ---------- 大屏（>1600px）适当放宽容器 ---------- */
@media (min-width: 1600px) {
  .topbar-inner, .page { max-width: 1520px; }
}
