:root {
  --bg: #0a0a0d;
  --bg-soft: #111117;
  --panel: #16161f;
  --line: #262632;
  --text: #e8e8ef;
  --muted: #8a8a9c;
  --accent: #d92b4b;
  --accent-soft: #ff4d6d;
  --violet: #7c4dff;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 400px at 12% -10%, rgba(217, 43, 75, .18), transparent 70%),
    radial-gradient(600px 400px at 95% 0%, rgba(124, 77, 255, .12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 26px;
  background: rgba(10, 10, 13, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .12em;
  font-weight: 700;
}
.dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent), 0 0 26px rgba(217, 43, 75, .5);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.stats {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.controls {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

input[type="search"], select {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
input[type="search"] { width: 210px; }
input[type="search"]:focus, select:focus { border-color: var(--accent); }

.btn {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.icon { padding: 9px 12px; font-size: 16px; line-height: 1; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #a01834);
  border-color: transparent;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; color: var(--muted); }

/* ---------------- 网格 ---------------- */
main {
  position: relative;
  z-index: 1;
  padding: 26px;
  max-width: 1680px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 43, 75, .55);
  box-shadow: 0 16px 40px -18px rgba(217, 43, 75, .55);
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1b1b26, #0e0e15);
  overflow: hidden;
}
.thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.card:hover .thumb img { transform: scale(1.05); }

.thumb .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #4a4a5c;
  letter-spacing: .1em;
}

.badge-dur, .badge-size {
  position: absolute;
  bottom: 8px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  background: rgba(0, 0, 0, .74);
  color: #fff;
  backdrop-filter: blur(6px);
}
.badge-dur { right: 8px; }
.badge-size { left: 8px; color: var(--muted); }

.card-body { padding: 12px 14px 14px; }
.card-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.play-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0, 0, 0, .3);
  transition: opacity .18s;
  font-size: 40px;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .8);
}
.card:hover .play-hint { opacity: 1; }

/* ---------------- 空状态 / 页脚 ---------------- */
.empty {
  text-align: center;
  padding: 90px 20px;
  color: var(--muted);
}
.empty .hint { font-size: 13px; }
.empty code {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--accent-soft);
  font-size: 12.5px;
}

.footer {
  position: relative;
  z-index: 1;
  padding: 24px 26px 40px;
  text-align: center;
  color: #4d4d5e;
  font-size: 12px;
}

/* ---------------- 播放器 ---------------- */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 4, 7, .95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.viewer[hidden] { display: none; }

.viewer-stage {
  position: relative;
  width: min(1400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#video {
  width: 100%;
  max-height: 76vh;
  background: #000;
  border-radius: 10px;
  outline: none;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}

.viewer-close {
  position: absolute;
  top: -34px;
  right: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.viewer-close:hover { color: #fff; }

.viewer-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 88px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s;
}
.viewer-nav:hover { background: rgba(217, 43, 75, .3); }
.viewer-nav.prev { left: 18px; }
.viewer-nav.next { right: 18px; }

.viewer-info {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
  word-break: break-all;
}
.viewer-info strong { color: var(--text); font-weight: 600; }

/* ---------------- 内容警示 ---------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 5, 8, .97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.gate[hidden] { display: none; }

.gate-box {
  max-width: 480px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 34px;
}
.gate-mark {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px -8px var(--accent);
}
.gate-box h1 { margin: 0 0 16px; font-size: 20px; letter-spacing: .1em; }
.gate-box p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.gate-box strong { color: var(--accent-soft); }
.gate-box .btn { margin: 16px 6px 0; }

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .stats { order: 3; width: 100%; }
  .controls { width: 100%; margin-left: 0; }
  input[type="search"] { flex: 1; width: auto; }
  main { padding: 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .viewer { padding: 14px; }
  .viewer-nav { display: none; }
}

/* ============================================================
   功能扩展：标签页 / 图片 / 投稿 / 管理后台
   ============================================================ */

/* ---------------- 标签页 ---------------- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 4px;
}
.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--accent), #a01834);
  color: #fff;
  font-weight: 600;
}

.panel { position: relative; z-index: 1; }

/* ---------------- 图片网格 ---------------- */
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.img-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease;
}
.img-card:hover {
  transform: translateY(-2px);
  border-color: rgba(217, 43, 75, .55);
}
.img-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #12121a;
}
.img-cap {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--line);
}

/* ---------------- 图片大图 ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(4, 4, 7, .96);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: min(1200px, 92vw);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}

/* ---------------- 投稿 ---------------- */
.upload-box {
  max-width: 620px;
  margin: 30px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
}
.upload-box h2 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: .08em;
}
.upload-box .hint {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.drop {
  display: block;
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  word-break: break-all;
  margin-bottom: 14px;
}
.drop:hover, .drop.over {
  border-color: var(--accent);
  background: rgba(217, 43, 75, .07);
  color: var(--text);
}

.text-input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
  font-family: inherit;
}
.text-input:focus { border-color: var(--accent); }

.progress {
  height: 5px;
  background: var(--bg-soft);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 16px;
}
.progress .bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  transition: width .25s ease;
}

.notice {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
}
.notice.err { color: #ff6b81; }

/* ---------------- 管理后台 ---------------- */
.admin { max-width: 980px; margin: 0 auto; }

.admin-login {
  max-width: 420px;
  margin: 40px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
}
.admin-login h2 { margin: 0 0 8px; font-size: 18px; }
.admin-login .hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.admin-login .btn { width: 100%; }
.admin-login .notice { text-align: center; }

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.admin-head h2 { margin: 0; font-size: 18px; letter-spacing: .06em; }

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.atab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 9px;
  padding: 8px 15px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.atab.active { color: var(--text); border-color: var(--accent); background: rgba(217, 43, 75, .1); }
.chip {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  text-align: center;
  margin-left: 4px;
}

.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0;
}
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 16px;
  transition: opacity .2s;
}
.admin-row.done { opacity: .45; }
.admin-info { min-width: 0; flex: 1; }
.admin-name {
  font-size: 14px;
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 4px;
}
.admin-meta {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.admin-actions {
  display: flex;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn.small {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
  line-height: 1.5;
}
.btn.ok { border-color: rgba(64, 200, 120, .5); color: #5ddc98; }
.btn.ok:hover { background: rgba(64, 200, 120, .12); }
.btn.warn { border-color: rgba(230, 180, 60, .5); color: #e6b43c; }
.btn.warn:hover { background: rgba(230, 180, 60, .12); }
.btn.danger { border-color: rgba(217, 43, 75, .55); color: #ff6b81; }
.btn.danger:hover { background: rgba(217, 43, 75, .14); }

.st { font-weight: 600; }
.st-pending { color: #e6b43c; }
.st-approved { color: #5ddc98; }
.st-rejected { color: #ff6b81; }

/* ---------------- 页脚 ---------------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.footer .credit {
  font-size: 12.5px;
  color: #6a6a80;
  letter-spacing: .02em;
}
.footer .credit strong {
  color: var(--accent-soft);
  font-weight: 600;
}
.footer .credit a {
  color: #7a7a92;
  text-decoration: none;
  border-bottom: 1px dotted #3a3a4a;
}
.footer .credit a:hover { color: var(--accent-soft); border-bottom-color: var(--accent-soft); }
.footer .sep { margin: 0 6px; opacity: .5; }
.foot-meta { font-size: 11.5px; color: #45455a; }
.admin-link {
  background: none;
  border: none;
  color: #34344a;
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 8px;
  font-family: inherit;
  transition: color .15s;
}
.admin-link:hover { color: var(--muted); }

@media (max-width: 720px) {
  .tabs { order: 2; }
  .controls { display: none !important; }
  .img-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .admin-row { flex-direction: column; align-items: stretch; }
  .admin-actions { justify-content: flex-start; }
  .upload-box, .admin-login { padding: 22px 18px; }
  .lightbox { padding: 16px; }
}
