:root {
  --bg: #0e0f13;
  --surface: #181a21;
  --surface-2: #20232c;
  --border: #2a2e39;
  --text: #e8eaf0;
  --muted: #9aa0ad;
  --accent: #5b8cff;
  --accent-2: #3a6bf0;
  --good: #38c172;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; text-decoration: none; }

.site-header {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 600; font-size: 18px; color: #fff; white-space: nowrap; }
.search { display: flex; flex: 1; max-width: 520px; margin: 0 auto; gap: 8px; }
.search input {
  flex: 1; padding: 9px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search button, .login-card button, .login-card input[type=submit] {
  padding: 9px 18px; border-radius: 999px; border: none;
  background: var(--accent-2); color: #fff; font-weight: 500; cursor: pointer; font-size: 14px;
}
.search button:hover { background: var(--accent); }
.logout { color: var(--muted); font-size: 13px; white-space: nowrap; }
.logout:hover { color: var(--text); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 48px; }

.listing-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.listing-head h1 { font-size: 22px; margin: 0; }
.count { color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-poster {
  aspect-ratio: 2/3; display: flex; align-items: center; justify-content: center;
  font-size: 52px; font-weight: 700; color: #3a4152;
  background: linear-gradient(135deg, #232733, #171a22);
}
.card-body { padding: 10px 12px 14px; }
.card-title { font-weight: 500; font-size: 14px; line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 12px; }
.card-tag { margin-top: 8px; font-size: 11px; color: var(--accent); }

.pager { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 32px; }
.pager a { padding: 8px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.pager a:hover { border-color: var(--accent); }
.pager .disabled { padding: 8px 16px; color: #4a4f5c; }
.pageinfo { color: var(--muted); font-size: 14px; }

.back { display: inline-block; color: var(--muted); margin-bottom: 16px; font-size: 14px; }
.back:hover { color: var(--text); }
.detail { display: flex; gap: 24px; margin-bottom: 8px; }
.detail-poster {
  width: 160px; min-width: 160px; aspect-ratio: 2/3; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 700;
  color: #3a4152; background: linear-gradient(135deg, #232733, #171a22);
}
.detail-info h1 { margin: 0 0 4px; font-size: 26px; }
.detail-info .year { color: var(--muted); font-weight: 400; }
.orig { color: var(--muted); margin-bottom: 10px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.detail-meta span { background: var(--surface-2); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px; font-size: 12px; color: var(--muted); }
.synopsis { color: #cfd3dc; margin-top: 12px; max-width: 60ch; }

.downloads-head { margin: 32px 0 14px; font-size: 18px; }
.downloads { display: flex; flex-direction: column; gap: 14px; }
.quality-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.quality-head { display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.quality-name { font-weight: 600; letter-spacing: .04em; }
.quality-size { color: var(--muted); font-size: 13px; }
.mirror-list { display: flex; flex-direction: column; }
.mirror {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.mirror:first-child { border-top: none; }
.mirror:hover { background: var(--surface-2); }
.mirror-name { font-weight: 500; }
.mirror-size { color: var(--muted); font-size: 13px; }
.mirror-go { color: var(--good); font-weight: 500; font-size: 14px; white-space: nowrap; }

.login-card {
  max-width: 360px; margin: 12vh auto 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; text-align: center;
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.login-card input[type=password] {
  padding: 11px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 15px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

.muted { color: var(--muted); }
.error { color: #ff6b6b; font-size: 14px; }
.error-page { text-align: center; padding: 12vh 0; }
.error-page h1 { font-size: 64px; margin: 0; color: #3a4152; }
.error-page a { color: var(--accent); }

.site-footer { text-align: center; color: #4a4f5c; font-size: 13px; padding: 24px; border-top: 1px solid var(--border); }

@media (max-width: 640px) {
  .detail { flex-direction: column; }
  .detail-poster { width: 120px; min-width: 120px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
}
