:root {
  --bg: #0a0c10;
  --panel: #12151c;
  --panel-2: #171b24;
  --line: #232937;
  --text: #e6ebf5;
  --muted: #8b95a7;
  --accent: #4ea1ff;
  --accent-2: #ff6b8b;
  --radius: 12px;
}
* { box-sizing: border-box; }
/* 关键：hidden 属性靠浏览器默认样式的 display:none 生效，而作者样式优先级更高。
   .lightbox 和 .center 都是 display:flex，会把 hidden 完全盖住 —— 于是 element.hidden = true
   看起来就像"按钮失灵"。这条规则让 hidden 永远赢。 */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1200px, 100% - 48px); margin: 0 auto; }

.site-head { border-bottom: 1px solid var(--line); padding: 28px 0 22px; }
.head-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: .5px; }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.links { display: flex; gap: 16px; font-size: 14px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 18px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: #33405a; }
.chip.on { color: #04121f; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.count { color: var(--muted); font-size: 13px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; padding-bottom: 60px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: #35435f; }
.thumb { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1b2233, #101520); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.badge { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.72); color: #fff; font-size: 12px; padding: 2px 7px; border-radius: 6px; }
.play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s ease; background: rgba(0,0,0,.28); }
.card:hover .play { opacity: 1; }
.play span { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.92); color: #0a0c10; display: flex; align-items: center; justify-content: center; font-size: 16px; padding-left: 3px; }
.card-body { padding: 12px 14px 15px; }
.card-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.card-tag { font-size: 11px; color: var(--accent-2); border: 1px solid #3a2430; background: #1b1418; padding: 1px 8px; border-radius: 999px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
.foot { color: #5d6779; font-size: 12px; padding: 26px 0 40px; border-top: 1px solid var(--line); }

.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(4,6,10,.86); backdrop-filter: blur(3px); }
.lb-panel { position: relative; width: min(1180px, 100%); max-height: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px; overflow: auto; }
.lb-stage { background: #000; aspect-ratio: 16 / 9; }
.lb-stage video { width: 100%; height: 100%; display: block; background: #000; }
.lb-info { padding: 18px 22px 22px; }
.lb-info h2 { margin: 0 0 10px; font-size: 19px; }
.lb-info p { margin: 10px 0 0; color: #c3ccdb; white-space: pre-wrap; }
.lb-info .chips { margin-bottom: 2px; }
.lb-meta { margin-top: 12px; color: var(--muted); font-size: 13px; }
.lb-icon {
  position: absolute; z-index: 2; border: 1px solid var(--line); background: rgba(10,12,16,.82); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1;
}
.lb-icon:hover { background: var(--accent); color: #04121f; border-color: var(--accent); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-icon[disabled] { opacity: .3; cursor: default; }
.lb-icon[disabled]:hover { background: rgba(10,12,16,.82); color: var(--text); border-color: var(--line); }

.center { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.box { width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.box h2 { margin: 0 0 14px; font-size: 17px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
input, textarea, select {
  width: 100%; background: #0d1017; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 10px; font: inherit; font-size: 14px;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 74px; }
button.primary {
  width: 100%; margin-top: 18px; background: var(--accent); color: #04121f; border: 0;
  border-radius: 8px; padding: 11px; font-size: 15px; font-weight: 600; cursor: pointer;
}
button.primary:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
button.ghost:hover { border-color: #3b4a68; }
button.danger { background: transparent; border: 1px solid #4a2430; color: #ff8098; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
button.danger:hover { background: #2a151c; }
.msg { margin-top: 12px; font-size: 13px; min-height: 20px; }
.msg.err { color: #ff8098; }
.msg.ok { color: #58d6a0; }

.admin-wrap { width: min(1200px, 100% - 48px); margin: 0 auto; padding: 26px 0 70px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 26px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h2 { margin: 0 0 6px; font-size: 17px; }
.panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.drop { border: 1px dashed #33405a; border-radius: 10px; padding: 20px; text-align: center; color: var(--muted); cursor: pointer; font-size: 14px; }
.drop.hot { border-color: var(--accent); color: var(--text); }
.poster-preview { margin-top: 12px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: none; }
.poster-preview img { width: 100%; display: block; }
.progress { height: 8px; background: #0d1017; border: 1px solid var(--line); border-radius: 999px; margin-top: 14px; overflow: hidden; display: none; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.admin-list { display: grid; gap: 12px; }
.item { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; align-items: center; }
.item .mini { aspect-ratio: 16/9; border-radius: 7px; overflow: hidden; background: #0d1017; }
.item .mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item h3 { margin: 0 0 5px; font-size: 14px; }
.item .m { color: var(--muted); font-size: 12px; }
.item .acts { display: flex; gap: 8px; }
.login-note { color: var(--muted); font-size: 12px; margin-top: 14px; }
@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
  .item { grid-template-columns: 96px minmax(0, 1fr); }
  .item .acts { grid-column: 1 / -1; }
}
