:root {
  --bg: #1A1817;
  --surface: #2E2A27;
  --primary: #C9A15A;
  --accent: #E06C3A;
  --text: #F0E6D8;
  --muted: #8C8279;
  --radius: 6px;
  --font-heading: 'Cinzel', 'Playfair Display', 'Times New Roman', serif;
  --font-body: 'IBM Plex Mono', 'Courier New', monospace;
  --border: rgba(201, 161, 90, 0.25);
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(201, 161, 90, 0.06), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(224, 108, 58, 0.05), transparent 45%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; transition: color 0.25s ease; }
a:hover { color: var(--primary); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 24, 23, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo::before {
  content: "✦";
  color: var(--accent);
  font-size: 18px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  border-radius: var(--radius);
  white-space: nowrap;
  border: 1px solid transparent;
}
.nav a:hover,
.nav a.active {
  color: var(--primary);
  border-color: var(--border);
  background: rgba(201, 161, 90, 0.08);
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
}
.search-box input {
  width: 160px;
  padding: 8px 12px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  padding: 8px 14px;
  border: none;
  background: var(--primary);
  color: var(--bg);
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease;
}
.search-box button:hover { background: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.hero-slide {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7;
  overflow: hidden;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.hero-slide:hover img { transform: scale(1.04); }
.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 28px 22px;
  background: linear-gradient(to top, rgba(26, 24, 23, 0.96), transparent);
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--text);
  margin-bottom: 6px;
}
.hero-info p {
  color: var(--muted);
  font-size: 13px;
  max-width: 640px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 22px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  border: 1px solid var(--primary);
  transition: all 0.25s ease;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 18px rgba(224, 108, 58, 0.5);
}

/* ===== Section ===== */
.sec { margin: 40px 0; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 60px;
  height: 2px;
  background: var(--primary);
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--primary);
}
.sec-more {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.sec-more:hover { color: var(--accent); }

/* ===== Grid & Card ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #14120f;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-cover img { transform: scale(1.06); }
.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg);
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.card-info { padding: 10px 12px 12px; }
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Category list ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  transition: all 0.25s ease;
}
.cat-item:hover {
  border-color: var(--primary);
  background: rgba(201, 161, 90, 0.08);
  color: var(--primary);
}
.cat-count {
  font-size: 11px;
  color: var(--muted);
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ===== Rank list ===== */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s ease;
}
.rank-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}
.rank-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rank-item:nth-child(-n+3) .rank-num {
  color: var(--bg);
  background: var(--primary);
  border-color: var(--primary);
}
.rank-title {
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-score {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

/* ===== Detail ===== */
.detail { margin: 32px 0; }
.detail-head {
  display: flex;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.detail-cover {
  flex-shrink: 0;
  width: 240px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta { flex: 1; min-width: 0; }
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.detail-meta p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-meta p span { color: var(--text); }
.detail-score {
  display: inline-block;
  margin: 10px 0;
  padding: 4px 14px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--bg);
  background: var(--primary);
  border-radius: var(--radius);
  box-shadow: 0 0 16px rgba(201, 161, 90, 0.35);
}
.detail-body {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--primary);
  margin: 18px 0 10px;
  letter-spacing: 1px;
}
.detail-body p { margin-bottom: 12px; color: var(--muted); }

/* ===== Tags ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s ease;
}
.tag:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(201, 161, 90, 0.08);
}

/* ===== Pager ===== */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 36px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.25s ease;
}
.pg:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.pg.current {
  color: var(--bg);
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}
.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.link-item {
  font-size: 12px;
  color: var(--muted);
}
.link-item:hover { color: var(--primary); }

/* ===== Crumbs ===== */
.crumbs {
  padding: 16px 0;
  font-size: 12px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--primary); }

/* ===== Highlight ===== */
.hl {
  color: var(--accent);
  font-weight: 700;
  background: rgba(224, 108, 58, 0.12);
  border-radius: 2px;
  padding: 0 2px;
}

/* ===== Footer ===== */
.footer {
  margin-top: 60px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  background: rgba(46, 42, 39, 0.4);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 2;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }
.footer::before {
  content: "✦ ✦ ✦";
  display: block;
  margin-bottom: 14px;
  color: var(--primary);
  letter-spacing: 10px;
  font-size: 12px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .wrap { padding: 0 14px; }

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo { font-size: 18px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero-slide { aspect-ratio: 4 / 3; }
  .hero-info { padding: 30px 16px 16px; }
  .hero-info h2 { font-size: 18px; }
  .hero-info p { font-size: 12px; }

  .sec { margin: 28px 0; }
  .sec-title { font-size: 17px; }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .cat-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .rank-list { grid-template-columns: 1fr; }

  .detail-head {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
  }
  .detail-cover {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }
  .detail-meta h1 { font-size: 20px; text-align: center; }
  .detail-meta p { text-align: center; }
  .detail-score { display: block; width: fit-content; margin: 10px auto; }
  .detail-body { padding: 16px; }

  .pg { min-width: 34px; height: 34px; padding: 0 9px; font-size: 12px; }
}