:root {
  --bg: #0c0e13;
  --surface: #141821;
  --surface-2: #1c222e;
  --border: #262e3d;
  --text: #eef2f8;
  --muted: #9aa6bc;
  --accent: #5b8cff;
  --accent-hover: #749eff;
  --ok: #38c172;
  --warn: #f59e0b;
  --err: #ef5350;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 14, 19, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 15px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--accent);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: #3a465e;
  background: #232a39;
}

.btn-icon {
  width: 36px;
  padding: 0;
}

.hero {
  position: relative;
  margin-top: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 220px;
}

.hero-img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
  object-position: center 22%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 12, 18, 0.18) 0%, rgba(10, 12, 18, 0.93) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-copy h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}

.hero-copy p {
  margin: 0;
  color: #dbe4f5;
  font-size: 14px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 24, 33, 0.85);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.access-bar {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.access-bar.attention {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.22);
}

.access-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.access-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.access-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.unlock-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.unlock-form input {
  height: 38px;
  width: 220px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.unlock-form input:focus {
  border-color: var(--accent);
}

.unlocked-state {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(56, 193, 114, 0.14);
  border: 1px solid rgba(56, 193, 114, 0.4);
  color: #6ce39d;
  font-size: 13px;
  font-weight: 600;
}

.access-msg {
  font-size: 12px;
  min-height: 16px;
  color: var(--muted);
}

.access-msg.error {
  color: var(--err);
}

.access-msg.ok {
  color: #6ce39d;
}

.filters-row {
  margin-top: 20px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pill:hover {
  color: var(--text);
  border-color: #3a465e;
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.pack-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #090b0f;
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-pill {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.meta-pill.rating {
  color: #f6c453;
}

.meta-pill.sfw {
  color: #6ce39d;
}

.card-actions {
  margin-top: auto;
  padding-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
}

.footer-inner p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.84);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.modal-body {
  padding: 12px;
  overflow: auto;
  background: #0a0c10;
  text-align: center;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }
  .topbar-inner {
    padding: 10px 14px;
  }
  .hero-img {
    height: 190px;
  }
  .hero-overlay {
    padding: 16px;
  }
  .hero-copy h1 {
    font-size: 18px;
  }
  .access-bar {
    padding: 14px;
  }
  .access-right {
    width: 100%;
    align-items: stretch;
  }
  .unlock-form input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .pack-grid {
    grid-template-columns: 1fr;
  }
}
