:root {
  --bg: #F2E8D5;
  --surface: #FBF5E9;
  --primary: #C0392B;
  --accent: #1B4F8A;
  --text: #1C1A17;
  --muted: #8A7E6B;
  --radius: 6px;
  --shadow: 5px 5px 0 var(--primary);
  --shadow-soft: 3px 3px 0 rgba(28, 26, 23, 0.85);
  --border: 2px solid var(--text);
  --font-heading: 'Arial Black', 'Helvetica Neue', Impact, sans-serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

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

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(28, 26, 23, 0.06) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

button, input {
  font-family: inherit;
  font-size: inherit;
}

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

/* ============ Header ============ */
.header {
  background: var(--surface);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 0 rgba(192, 57, 43, 0.15);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--primary);
  border: var(--border);
  border-radius: 2px;
  display: inline-block;
}

.logo img {
  max-height: 40px;
  width: auto;
}

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

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

.nav a {
  display: inline-block;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: all 0.18s ease;
}

.nav a:hover {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--text);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-soft);
}

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

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 12px;
  width: 160px;
  color: var(--text);
}

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

.search-box button {
  border: none;
  border-left: var(--border);
  background: var(--primary);
  color: var(--surface);
  padding: 8px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease;
}

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

/* ============ Hero ============ */
.hero {
  position: relative;
  margin: 32px auto;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-slide {
  position: relative;
  display: none;
  aspect-ratio: 21 / 9;
  background: var(--text);
}

.hero-slide:first-child {
  display: block;
}

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

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 40px 32px 28px;
  background: linear-gradient(to top, rgba(28, 26, 23, 0.92), transparent);
  color: var(--surface);
}

.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 var(--primary);
}

.hero-info p {
  font-size: 14px;
  color: rgba(251, 245, 233, 0.82);
  margin-bottom: 16px;
  max-width: 620px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  background: var(--primary);
  color: var(--surface);
  font-weight: 700;
  font-size: 14px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--accent);
}

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

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--text);
  position: relative;
}

.sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 64px;
  height: 3px;
  background: var(--primary);
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: var(--border);
  transform: rotate(45deg);
  display: inline-block;
}

.sec-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 4px 12px;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.sec-more:hover {
  background: var(--primary);
  color: var(--surface);
  box-shadow: var(--shadow-soft);
  transform: translate(-2px, -2px);
}

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

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--primary);
}

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

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-cover img {
  transform: scale(1.05);
}

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: var(--surface);
  font-family: var(--font-heading);
  font-size: 13px;
  padding: 2px 8px;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--text);
}

.card-info {
  padding: 10px 12px 12px;
  border-top: var(--border);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Cat List ============ */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.cat-item {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cat-item:hover {
  background: var(--primary);
  color: var(--surface);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--accent);
}

.cat-item:hover .cat-count {
  color: var(--surface);
  border-color: var(--surface);
}

.cat-item span.cat-name,
.cat-item a {
  font-weight: 700;
  font-size: 15px;
}

.cat-count {
  font-size: 12px;
  color: var(--muted);
  border: 1.5px solid var(--muted);
  border-radius: 20px;
  padding: 0 10px;
  transition: all 0.18s ease;
}

/* ============ Rank List ============ */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.rank-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--primary);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 22px;
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

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

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

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

/* ============ Detail ============ */
.detail {
  margin: 32px 0;
}

.detail-head {
  display: flex;
  gap: 28px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}

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

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

.detail-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.25;
}

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

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

.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 20px;
  background: var(--primary);
  color: var(--surface);
  padding: 4px 16px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  width: fit-content;
}

.detail-body {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  line-height: 1.85;
  font-size: 15px;
}

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

/* ============ Tag List ============ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  color: var(--text);
  transition: all 0.18s ease;
}

.tag:hover {
  background: var(--primary);
  color: var(--surface);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-soft);
}

/* ============ Pager ============ */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 36px 0;
}

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 14px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: 2px 2px 0 var(--text);
  transition: all 0.18s ease;
}

.pg:hover {
  background: var(--primary);
  color: var(--surface);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--accent);
}

.pg.current {
  background: var(--primary);
  color: var(--surface);
  box-shadow: 3px 3px 0 var(--accent);
  cursor: default;
}

.pg.disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

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

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 3px 12px;
  border: 1.5px dashed var(--muted);
  border-radius: var(--radius);
  transition: all 0.18s ease;
}

.link-item:hover {
  color: var(--primary);
  border-color: var(--primary);
  border-style: solid;
}

/* ============ Footer ============ */
.footer {
  margin-top: 48px;
  background: var(--text);
  color: rgba(251, 245, 233, 0.78);
  border-top: 4px solid var(--primary);
  padding: 32px 0;
  font-size: 13px;
}

.footer .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer a {
  color: var(--surface);
  transition: color 0.18s ease;
}

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

/* ============ Crumbs ============ */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.crumbs a {
  color: var(--text);
  font-weight: 700;
  transition: color 0.18s ease;
}

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

/* ============ Highlight ============ */
.hl {
  background: var(--primary);
  color: var(--surface);
  padding: 0 3px;
  border-radius: 2px;
  font-weight: 700;
}

/* ============ 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;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 10px;
  }

  .logo {
    font-size: 18px;
  }

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

  .nav a {
    padding: 5px 12px;
    font-size: 13px;
  }

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

  .search-box input {
    width: 110px;
    padding: 7px 10px;
  }

  .search-box button {
    padding: 7px 12px;
  }

  .hero {
    margin: 20px auto;
  }

  .hero-slide {
    aspect-ratio: 4 / 3;
  }

  .hero-info {
    padding: 24px 16px 18px;
  }

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

  .hero-info p {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .sec {
    margin: 28px 0;
  }

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

  .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;
    gap: 10px;
  }

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

  .detail-cover {
    width: 160px;
    margin: 0 auto;
  }

  .detail-meta h1 {
    font-size: 20px;
    text-align: center;
  }

  .detail-score {
    margin: 0 auto;
  }

  .detail-body {
    padding: 16px;
    font-size: 14px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-meta {
    font-size: 11px;
  }

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

@media (max-width: 380px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .card-info {
    padding: 8px 9px 10px;
  }
}