:root {
  --bg: #0F0E0C;
  --surface: #1A1815;
  --primary: #D9381E;
  --accent: #E8DCC8;
  --text: #F2EDE4;
  --muted: #8C8478;
  --radius: 2px;
  --font-heading: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --font-body: "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  --line: rgba(232, 220, 200, 0.12);
  --line-strong: rgba(232, 220, 200, 0.22);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  background-image: radial-gradient(rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 3px 3px;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
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 24px;
}

/* ---------- Header ---------- */
.header {
  border-bottom: 1px solid var(--line);
  background: rgba(15,14,12,0.92);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  margin-right: 8px;
  vertical-align: middle;
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--primary);
}
.search-box {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.search-box input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  width: 150px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  background: var(--primary);
  border: 0;
  color: #fff;
  font-size: 12px;
  padding: 7px 12px;
  cursor: pointer;
  font-family: var(--font-body);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.hero-slide {
  position: relative;
  aspect-ratio: 21 / 9;
  min-height: 260px;
  opacity: 0;
  animation: heroFade 12s infinite;
}
.hero-slide:nth-child(2) { animation-delay: 4s; }
.hero-slide:nth-child(3) { animation-delay: 8s; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
}
.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 32px;
  background: linear-gradient(to top, rgba(15,14,12,0.95), transparent);
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.hero-info p {
  color: var(--muted);
  font-size: 13px;
  max-width: 640px;
  margin-bottom: 14px;
}
@keyframes heroFade {
  0% { opacity: 0; }
  4% { opacity: 1; }
  30% { opacity: 1; }
  34% { opacity: 0; }
  100% { opacity: 0; }
}

.btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  border-radius: var(--radius);
  letter-spacing: 0.05em;
  transition: background .2s, transform .2s;
}
.btn:hover {
  background: #b52c15;
  color: #fff;
  transform: translateY(-1px);
}

/* ---------- Section ---------- */
.sec { margin: 40px 0; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.sec-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--primary);
  margin-right: 10px;
  vertical-align: -2px;
}
.sec-more {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.sec-more:hover { color: var(--primary); }

/* ---------- Grid & Card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #000;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.card:hover .card-cover img { transform: scale(1.04); }
.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
}
.card-info { padding: 10px 12px 12px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.card:hover .card-title { color: var(--accent); }
.card-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

/* ---------- Cat list ---------- */
.cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  transition: border-color .2s, color .2s;
}
.cat-item:hover { border-color: var(--primary); color: var(--accent); }
.cat-count {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-body);
}

/* ---------- Rank list ---------- */
.rank-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.rank-item:hover { background: rgba(217,56,30,0.05); }
.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(--line-strong);
  border-radius: var(--radius);
}
.rank-item:nth-child(-n+3) .rank-num {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.rank-title {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.03em;
}

/* ---------- Detail ---------- */
.detail { margin: 32px 0; }
.detail-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-strong);
}
.detail-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #000;
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta { display: flex; flex-direction: column; gap: 12px; }
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
}
.detail-meta .sub { color: var(--muted); font-size: 13px; }
.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-heading);
}
.detail-score span { font-size: 12px; color: var(--muted); font-weight: 400; }
.detail-meta ul { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.detail-meta ul li { color: var(--muted); }
.detail-meta ul li b { color: var(--accent); font-weight: 500; margin-right: 8px; }
.detail-body {
  margin-top: 28px;
  font-size: 14px;
  line-height: 1.9;
  color: #d8d2c8;
}
.detail-body p { margin-bottom: 14px; }

/* ---------- Tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: color .2s, border-color .2s;
}
.tag:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- 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: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: color .2s, border-color .2s, background .2s;
}
.pg:hover { color: var(--accent); border-color: var(--primary); }
.pg.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pg.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.link-item {
  font-size: 12px;
  color: var(--muted);
  transition: color .2s;
}
.link-item:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 48px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

/* ---------- Crumbs ---------- */
.crumbs {
  padding: 16px 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { margin: 0 6px; opacity: 0.5; }

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

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .wrap { padding: 0 14px; }
  .header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .logo { font-size: 17px; }
  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero-slide { aspect-ratio: 4 / 3; min-height: 200px; }
  .hero-info { padding: 18px; }
  .hero-info h2 { font-size: 19px; }
  .hero-info p { font-size: 12px; margin-bottom: 10px; }

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

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .card-info { padding: 8px 10px 10px; }

  .cat-list { grid-template-columns: repeat(2, 1fr); }

  .detail-head {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .detail-cover {
    max-width: 200px;
    margin: 0 auto;
  }
  .detail-meta h1 { font-size: 21px; text-align: center; }
  .detail-meta .sub { text-align: center; }
  .detail-score { justify-content: center; }

  .rank-item { gap: 10px; padding: 10px 2px; }
}