:root {
  --bg: #F7F2E9;
  --surface: #FFFDF8;
  --primary: #C43B2E;
  --accent: #2B2B2B;
  --text: #1C1A17;
  --muted: #8A8478;
  --line: rgba(28, 26, 23, 0.12);
  --radius: 4px;
  --font-heading: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --wrap: 1200px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(43, 43, 43, 0.015) 0px,
    rgba(43, 43, 43, 0.015) 1px,
    transparent 1px,
    transparent 4px
  );
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0; font-weight: 700; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Header ============ */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.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(--text);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo::before {
  content: "";
  width: 6px;
  height: 24px;
  background: var(--primary);
  border-radius: 1px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}
.nav a:hover,
.nav a.active {
  color: var(--primary);
  background: rgba(196, 59, 46, 0.06);
}
.search-box {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  width: 160px;
  font-family: var(--font-body);
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .2s;
}
.search-box button:hover { opacity: .88; }

/* ============ Hero ============ */
.hero {
  position: relative;
  margin: 28px auto;
  max-width: var(--wrap);
  padding: 0 24px;
}
.hero-slide {
  position: relative;
  display: none;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 2px 16px rgba(28, 26, 23, 0.06);
  animation: heroFade .8s ease;
}
.hero-slide.active { display: block; }
@keyframes heroFade { from { opacity: 0; } to { opacity: 1; } }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(28,26,23,.78) 0%, rgba(28,26,23,.35) 45%, transparent 75%);
  pointer-events: none;
}
.hero-slide img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}
.hero-info {
  position: absolute;
  left: 48px;
  bottom: 48px;
  z-index: 2;
  max-width: 520px;
  color: #fff;
}
.hero-info h2 {
  font-size: 40px;
  line-height: 1.2;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.hero-info p {
  font-size: 14px;
  color: rgba(255,255,255,.82);
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn {
  display: inline-block;
  padding: 10px 26px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(196, 59, 46, .3);
}

/* ============ Section ============ */
.sec { margin: 44px auto; max-width: var(--wrap); padding: 0 24px; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.sec-title {
  font-size: 24px;
  letter-spacing: 2px;
  position: relative;
  padding-left: 16px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 1px;
}
.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: 22px;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(28, 26, 23, .1);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.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: 2px 8px;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s, transform .25s;
  z-index: 2;
}
.card:hover .card-score { opacity: 1; transform: translateY(0); }
.card-info { padding: 10px 12px 12px; }
.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 12px;
  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: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color .2s, color .2s;
}
.cat-item:hover { border-color: var(--primary); color: var(--primary); }
.cat-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 10px;
}

/* ============ Rank List ============ */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 40px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left .2s;
}
.rank-item:hover { padding-left: 6px; }
.rank-num {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  min-width: 48px;
  text-align: center;
  opacity: .9;
}
.rank-title {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-title:hover { color: var(--primary); }
.rank-score {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* ============ Detail ============ */
.detail { margin: 36px auto; max-width: var(--wrap); padding: 0 24px; }
.detail-head {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 32px;
}
.detail-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  border: 6px solid var(--bg);
  box-shadow: 0 4px 20px rgba(28, 26, 23, .12);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { display: flex; flex-direction: column; justify-content: center; }
.detail-meta h1 {
  font-size: 34px;
  letter-spacing: 1px;
  margin-bottom: 16px;
  line-height: 1.25;
}
.detail-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 18px;
}
.detail-score span { font-size: 14px; color: var(--muted); font-family: var(--font-body); }
.detail-meta p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.detail-meta p strong { color: var(--text); font-weight: 500; }
.detail-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h2 {
  font-size: 20px;
  margin: 0 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
}
.detail-body p { margin: 0 0 16px; }

/* ============ Tags ============ */
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color .2s, border-color .2s;
}
.tag:hover { color: var(--primary); border-color: var(--primary); }

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

/* ============ Links ============ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: color .2s, border-color .2s;
}
.link-item:hover { color: var(--primary); border-color: var(--primary); }

/* ============ Footer ============ */
.footer {
  margin-top: 60px;
  padding: 36px 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

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

/* ============ Highlight ============ */
.hl {
  color: var(--primary);
  font-weight: 700;
  background: rgba(196, 59, 46, .08);
  padding: 0 2px;
  border-radius: 2px;
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(3, 1fr); }
  .detail-head { grid-template-columns: 220px 1fr; gap: 28px; padding: 24px; }
  .hero-info h2 { font-size: 32px; }
}

@media (max-width: 768px) {
  .wrap { padding: 0 16px; }
  .header .wrap { height: auto; flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .logo { font-size: 19px; }
  .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 { padding: 0 16px; margin: 18px auto; }
  .hero-slide img { aspect-ratio: 16 / 10; }
  .hero-info { left: 20px; right: 20px; bottom: 20px; max-width: none; }
  .hero-info h2 { font-size: 22px; margin-bottom: 8px; }
  .hero-info p { font-size: 12px; margin-bottom: 14px; }
  .btn { padding: 8px 20px; font-size: 13px; }

  .sec { padding: 0 16px; margin: 30px auto; }
  .sec-title { font-size: 19px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cat-list { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-item { padding: 12px 14px; font-size: 13px; }

  .rank-list { grid-template-columns: 1fr; gap: 0; }
  .rank-num { font-size: 26px; min-width: 38px; }

  .detail { padding: 0 16px; margin: 20px auto; }
  .detail-head {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px;
    text-align: center;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 24px; }
  .detail-score { font-size: 26px; }
  .detail-body { padding: 20px; font-size: 14px; }

  .footer { margin-top: 36px; padding: 24px 0; font-size: 12px; }
  .pager { gap: 6px; margin: 28px 0; }
  .pg { min-width: 34px; height: 34px; padding: 0 10px; font-size: 13px; }
}