:root {
  --bg: #FEFEFC;
  --surface: #FFFFFF;
  --primary: #C0392B;
  --accent: #8C7B6B;
  --text: #1C1A17;
  --muted: #9A948C;
  --line: #E8E4DE;
  --radius: 4px;
  --font-heading: "Noto Serif SC", "Songti SC", Georgia, 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: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 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: 64px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 1px;
  margin-right: 8px;
  vertical-align: 2px;
}

.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(--text);
  white-space: nowrap;
  border-radius: var(--radius);
  transition: background .2s ease, color .2s ease;
}
.nav a:hover {
  color: var(--primary);
  background: rgba(192, 57, 43, .06);
}

.search-box {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  padding: 7px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--text);
  width: 160px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity .2s ease;
}
.search-box button:hover { opacity: .88; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 24px auto;
  max-width: 1200px;
  padding: 0 20px;
}
.hero-slide {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 16 / 7;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 24px 20px;
  background: linear-gradient(to top, rgba(28, 26, 23, .82), rgba(28, 26, 23, 0));
  color: #fff;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: .5px;
}
.hero-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, .82);
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover {
  color: #fff;
  background: #A93226;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(192, 57, 43, .18);
}
.hero-info .btn { margin-top: 12px; }

/* ---------- Section ---------- */
.sec {
  margin: 36px auto;
  max-width: 1200px;
  padding: 0 20px;
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 20px;
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .5px;
  position: relative;
  padding-left: 12px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 1px;
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  transition: color .2s ease;
}
.sec-more:hover { color: var(--primary); }

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(192, 57, 43, .35);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #F4F1EC;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.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;
  font-family: var(--font-heading);
  padding: 2px 7px;
  border-radius: var(--radius);
  letter-spacing: .5px;
  box-shadow: 0 1px 3px rgba(192, 57, 43, .3);
}

.card-info {
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-family: var(--font-heading);
  letter-spacing: .3px;
}
.card-meta span { white-space: nowrap; }

/* ---------- Cat list ---------- */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color .2s ease, transform .2s ease;
}
.cat-item:hover {
  border-color: rgba(192, 57, 43, .4);
  transform: translateY(-2px);
  color: var(--primary);
}
.cat-count {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-heading);
}

/* ---------- Rank list ---------- */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 32px;
  border-top: 1px solid var(--line);
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .2s ease;
}
.rank-item:hover { background: rgba(192, 57, 43, .03); }
.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);
  border-radius: var(--radius);
}
.rank-item:nth-child(-n+3) .rank-num {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}
.rank-title {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- Detail ---------- */
.detail {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 20px;
}
.detail-head {
  display: flex;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #F4F1EC;
}
.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;
  font-weight: 700;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.detail-meta p {
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 6px;
  line-height: 1.8;
}
.detail-meta p strong { color: var(--text); font-weight: 600; }
.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}
.detail-body {
  padding: 24px 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin: 20px 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}
.detail-body p { margin-bottom: 12px; color: #3A3630; }

/* ---------- 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);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color .2s ease, border-color .2s ease;
}
.tag:hover {
  color: var(--primary);
  border-color: rgba(192, 57, 43, .4);
}

/* ---------- Pager ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 32px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font-heading);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s ease;
}
.pg:hover {
  color: var(--primary);
  border-color: rgba(192, 57, 43, .4);
}
.pg.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.pg.disabled {
  color: var(--muted);
  border-color: var(--line);
  opacity: .55;
  pointer-events: none;
  cursor: default;
}

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

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

/* ---------- Crumbs ---------- */
.crumbs {
  max-width: 1200px;
  margin: 16px auto 0;
  padding: 0 20px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.crumbs a { color: var(--accent); }
.crumbs a:hover { color: var(--primary); }

/* ---------- Highlight ---------- */
.hl {
  color: var(--primary);
  font-weight: 700;
  background: rgba(192, 57, 43, .06);
  padding: 0 2px;
  border-radius: 2px;
}

/* ---------- Fade in ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.sec, .card, .hero-slide { animation: fadeIn .4s ease both; }

/* ---------- 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;
    gap: 10px;
    padding: 10px 14px;
  }
  .logo { font-size: 19px; }
  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 2px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { padding: 5px 10px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 120px; }

  .hero { padding: 0 14px; margin: 16px auto; }
  .hero-slide { aspect-ratio: 4 / 3; }
  .hero-info { padding: 30px 16px 14px; }
  .hero-info h2 { font-size: 19px; }
  .hero-info p { font-size: 12px; }

  .sec { margin: 24px auto; padding: 0 14px; }
  .sec-title { font-size: 17px; }

  .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .card-info { padding: 8px; }
  .card-title { font-size: 13px; }
  .card-meta { font-size: 11px; }

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

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

  .detail { padding: 0 14px; margin: 18px auto; }
  .detail-head { flex-direction: column; gap: 16px; align-items: center; text-align: center; }
  .detail-cover { width: 160px; }
  .detail-meta h1 { font-size: 21px; }
  .detail-body { padding: 18px 0; }

  .crumbs { padding: 0 14px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .search-box input { width: 90px; }
}