:root {
  --bg: #F6EEDD;
  --surface: #FBF5E8;
  --primary: #E8354D;
  --accent: #00C9A7;
  --text: #221E1A;
  --muted: #7A6E62;
  --radius: 10px;
  --font-heading: 'Bebas Neue', 'Oswald', 'Impact', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --border: rgba(34, 30, 26, 0.12);
  --noise: radial-gradient(rgba(34,30,26,0.04) 1px, transparent 1px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--noise);
  background-size: 4px 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, .sec-title, .logo, .rank-num, .card-score, .detail-score {
  font-family: var(--font-heading);
  letter-spacing: 0.5px;
}

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

/* ============ HEADER ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 2px dashed var(--border);
  box-shadow: 0 2px 0 rgba(232, 53, 77, 0.08);
}

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

.logo {
  font-size: 26px;
  color: var(--primary);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(232, 53, 77, 0.25);
}

.logo span { color: var(--accent); }

.nav {
  flex: 1;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav::-webkit-scrollbar { display: none; }

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

.nav a:hover,
.nav a.active {
  color: var(--surface);
  background: var(--primary);
  box-shadow: 0 0 10px rgba(232, 53, 77, 0.45);
}

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

.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  padding: 7px 10px;
  width: 160px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
}

.search-box button {
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: var(--text);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  transition: filter .2s;
}
.search-box button:hover { filter: brightness(1.1); }

/* ============ HERO ============ */
.hero {
  position: relative;
  margin: 22px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--text);
  border: 2px solid var(--text);
  box-shadow: 0 0 0 4px var(--surface), 0 8px 24px rgba(34,30,26,0.18);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 201, 167, 0.06) 0 2px,
    transparent 2px 5px
  );
  mix-blend-mode: screen;
}

.hero-slide {
  position: relative;
  aspect-ratio: 16 / 8;
  min-height: 240px;
}

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

.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 24px 22px;
  background: linear-gradient(to top, rgba(34,30,26,0.92), transparent);
  color: var(--surface);
}

.hero-info h2 {
  margin: 0 0 6px;
  font-size: 34px;
  color: var(--surface);
  text-shadow: 0 0 12px rgba(0, 201, 167, 0.5);
}

.hero-info p {
  margin: 0 0 14px;
  font-size: 13px;
  color: rgba(251, 245, 232, 0.75);
  max-width: 640px;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--surface);
  font-weight: 700;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(232, 53, 77, 0.55);
  transition: transform .15s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 20px rgba(232, 53, 77, 0.8); }

/* ============ SECTION ============ */
.sec { margin: 34px 0; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--border);
}

.sec-title {
  margin: 0;
  font-size: 26px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 10px var(--accent);
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  transition: color .2s;
}
.sec-more:hover { color: var(--primary); }

/* ============ GRID / CARD ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 22px rgba(34,30,26,0.16);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--text);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.card:hover .card-cover img { transform: scale(1.06); }

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  font-size: 16px;
  background: var(--primary);
  color: var(--surface);
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(232, 53, 77, 0.7);
}

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

.card-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ============ CAT LIST ============ */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  transition: border-color .2s, color .2s, box-shadow .2s;
}
.cat-item:hover {
  border-color: var(--accent);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(0, 201, 167, 0.35);
}

.cat-count {
  font-size: 12px;
  color: var(--surface);
  background: var(--accent);
  border-radius: 20px;
  padding: 0 8px;
  line-height: 18px;
}

/* ============ RANK LIST ============ */
.rank-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

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

.rank-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--surface);
  background: var(--muted);
  border-radius: 8px;
}
.rank-item:nth-child(1) .rank-num { background: var(--primary); box-shadow: 0 0 10px rgba(232,53,77,0.6); }
.rank-item:nth-child(2) .rank-num { background: #C77B3A; }
.rank-item:nth-child(3) .rank-num { background: var(--accent); color: var(--text); }

.rank-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-score {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--primary);
}

/* ============ DETAIL ============ */
.detail { margin: 24px 0; }

.detail-head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--text);
  box-shadow: 0 0 0 4px var(--bg), 0 8px 20px rgba(34,30,26,0.2);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.detail-meta { flex: 1; min-width: 0; }

.detail-meta h1 {
  margin: 0 0 10px;
  font-size: 32px;
  color: var(--text);
}

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

.detail-score {
  display: inline-block;
  margin: 10px 0;
  font-size: 34px;
  color: var(--primary);
  text-shadow: 0 0 12px rgba(232, 53, 77, 0.4);
}

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

/* ============ TAGS ============ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 20px;
  background: rgba(0, 201, 167, 0.08);
}

/* ============ PAGER ============ */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 30px 0;
}

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: all .2s;
}
.pg:hover { border-color: var(--accent); color: var(--primary); }

.pg.current {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
  box-shadow: 0 0 12px rgba(232, 53, 77, 0.55);
}

.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============ LINKS ============ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 16px 0;
}

.link-item {
  font-size: 13px;
  color: var(--muted);
  transition: color .2s;
}
.link-item:hover { color: var(--accent); }

/* ============ FOOTER ============ */
.footer {
  margin-top: 40px;
  padding: 28px 0;
  background: var(--text);
  color: rgba(251, 245, 232, 0.7);
  font-size: 13px;
  text-align: center;
  border-top: 3px solid var(--primary);
}
.footer a { color: var(--accent); }
.footer a:hover { color: var(--primary); }
.footer p { margin: 6px 0; }

/* ============ CRUMBS ============ */
.crumbs {
  margin: 18px 0 6px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--text); }

/* ============ HIGHLIGHT ============ */
.hl {
  color: var(--primary);
  background: rgba(232, 53, 77, 0.12);
  padding: 0 2px;
  border-radius: 3px;
}

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

@media (max-width: 768px) {
  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 10px;
  }
  .logo { font-size: 22px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

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

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

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

  .detail-head { flex-direction: column; align-items: center; }
  .detail-cover { width: 60%; max-width: 240px; }
  .detail-meta { width: 100%; }
  .detail-meta h1 { font-size: 24px; text-align: center; }

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

  .pg { min-width: 34px; height: 34px; padding: 0 10px; }
}