* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0b0d12; --panel: #141821; --panel2: #1b202c; --line: #2a3040;
  --text: #e8eaf0; --muted: #8b93a7; --accent: #e0483c; --accent2: #ff6a5e;
}
body { background: var(--bg); color: var(--text); font-family: -apple-system, "Microsoft YaHei", "PingFang SC", sans-serif; min-height: 100vh; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-size: 19px; font-weight: 600; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; }
.dot { width: 9px; height: 9px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 12px var(--accent); }
.actions { display: flex; gap: 10px; }
.btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line); padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; transition: .15s; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); }

.hero { padding: 24px 24px 8px; max-width: 1600px; margin: 0 auto; }
.search { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 12px 16px; border-radius: 10px; font-size: 14px; outline: none; }
.search:focus { border-color: var(--accent); }
.cats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.cat { padding: 7px 15px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font-size: 13px; }
.cat.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat span { opacity: .6; margin-left: 5px; font-size: 11px; }

.progress { max-width: 1600px; margin: 12px auto 0; padding: 0 24px; }
.pbar { height: 4px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.pfill { height: 100%; width: 0%; background: var(--accent); transition: width .3s; }
.pmsg { color: var(--muted); font-size: 12px; margin-top: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; padding: 20px 24px 60px; max-width: 1600px; margin: 0 auto; }
.card { cursor: pointer; border-radius: 10px; overflow: hidden; background: var(--panel); transition: transform .15s, box-shadow .15s; border: 1px solid transparent; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.5); border-color: var(--line); }
.poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: var(--panel2); }
.info { padding: 9px 10px 12px; }
.title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--muted); font-size: 11px; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.tag { background: var(--panel2); padding: 1px 6px; border-radius: 4px; }
.rating { color: #ffc107; }
.empty { text-align: center; color: var(--muted); padding: 80px 20px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.player-box { width: min(1000px, 96vw); background: #000; border-radius: 12px; overflow: hidden; }
.player-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--panel); font-size: 15px; }
.x { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
video { width: 100%; max-height: 74vh; display: block; background: #000; }
.player-tip { padding: 10px 18px; color: var(--muted); font-size: 12px; background: var(--panel); }

.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: flex; justify-content: flex-end; }
.drawer-box { width: min(440px, 94vw); height: 100%; background: var(--panel); overflow-y: auto; }
.fields { padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.fields label { color: var(--text); font-size: 13px; margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.fields label small { color: var(--muted); font-size: 11px; font-weight: 400; }
.fields input { background: var(--panel2); border: 1px solid var(--line); color: var(--text); padding: 10px 12px; border-radius: 8px; font-size: 13px; outline: none; }
.fields input:focus { border-color: var(--accent); }
.row { display: flex; gap: 10px; margin-top: 22px; }
.row .btn { flex: 1; }
.testmsg { margin-top: 12px; font-size: 12px; color: var(--muted); min-height: 18px; }
.hidden { display: none !important; }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 12px; padding: 14px; }
  .topbar { padding: 12px 14px; }
  .brand { font-size: 16px; }
  .hero { padding: 16px 14px 4px; }
}
