:root {
  --bg: #1A1917;
  --surface: #24221F;
  --primary: #E85D1F;
  --accent: #F2B05B;
  --text: #F0E9DF;
  --muted: #9C9488;
  --radius: 6px;
  --font-heading: 'Courier New', 'Consolas', 'Menlo', monospace;
  --font-body: 'Helvetica Neue', 'Arial', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --border: rgba(240, 233, 223, 0.08);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 4px);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

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 {
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--text);
  white-space: nowrap;
  text-transform: uppercase;
}

.logo::before {
  content: "▮ ";
  color: var(--primary);
}

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

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover {
  color: var(--accent);
  background: rgba(232, 93, 31, 0.12);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 8px 12px;
  width: 180px;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box button {
  background: var(--primary);
  border: none;
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 21 / 9;
  min-height: 260px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  background-size: cover;
  background-position: center;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(26, 25, 23, 0.92) 0%, rgba(26, 25, 23, 0.55) 45%, transparent 100%);
}

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 32px;
  max-width: 60%;
  z-index: 2;
}

.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--text);
}

.hero-info p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 1px;
  color: #fff;
  background: var(--primary);
  padding: 9px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  transition: transform 0.2s, background 0.2s;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  transform: translateY(-2px);
}

/* ---------- Section ---------- */
.sec {
  margin: 40px 0;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}

.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}

.sec-more {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}

.sec-more:hover {
  color: var(--accent);
}

/* ---------- Grid & Card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg);
  overflow: hidden;
}

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

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  background: var(--primary);
  padding: 2px 8px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.card-info {
  padding: 10px 12px 12px;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Categories ---------- */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}

.cat-item:hover {
  border-color: var(--primary);
  color: var(--accent);
}

.cat-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 0 8px;
}

/* ---------- Ranking ---------- */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color 0.2s, transform 0.2s;
}

.rank-item:hover {
  border-color: var(--primary);
  transform: translateX(3px);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  min-width: 28px;
  text-align: center;
}

.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num {
  color: var(--accent);
}

.rank-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-score {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--accent);
}

/* ---------- Detail ---------- */
.detail {
  margin: 30px 0;
}

.detail-head {
  display: flex;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.detail-cover {
  flex-shrink: 0;
  width: 240px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.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;
  line-height: 1.3;
  margin-bottom: 14px;
}

.detail-meta p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

.detail-meta p span {
  color: var(--text);
}

.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  background: var(--primary);
  padding: 4px 16px;
  margin-bottom: 14px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

.detail-body {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}

.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin: 20px 0 10px;
  color: var(--accent);
}

.detail-body h2:first-child {
  margin-top: 0;
}

.detail-body p {
  margin-bottom: 12px;
}

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 10px;
  transition: color 0.2s, border-color 0.2s;
}

.tag:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- 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-family: var(--font-heading);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s, color 0.2s;
}

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

.pg.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pg.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 20px 0;
}

.link-item {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}

.link-item:hover {
  color: var(--accent);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 50px;
  background: var(--surface);
  border-top: 2px solid var(--primary);
  padding: 30px 0;
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.footer a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--accent);
}

.footer p {
  margin-bottom: 6px;
}

/* ---------- Crumbs ---------- */
.crumbs {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 0;
}

.crumbs a {
  color: var(--muted);
  transition: color 0.2s;
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs span {
  color: var(--text);
}

/* ---------- Highlight ---------- */
.hl {
  color: var(--bg);
  background: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}

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

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

  .header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 10px;
  }

  .logo {
    font-size: 17px;
  }

  .nav {
    order: 3;
    width: 100%;
    flex: none;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .search-box {
    margin-left: auto;
  }

  .search-box input {
    width: 120px;
  }

  .hero {
    aspect-ratio: 4 / 3;
    min-height: 220px;
  }

  .hero-info {
    max-width: 100%;
    padding: 20px;
  }

  .hero-info h2 {
    font-size: 20px;
  }

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

  .rank-list {
    grid-template-columns: 1fr;
  }

  .detail-head {
    flex-direction: column;
    padding: 16px;
  }

  .detail-cover {
    width: 160px;
    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: 0 auto 14px;
  }

  .detail-body {
    padding: 16px;
  }

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