:root {
  --bg: #F2F1EC;
  --surface: #F8F7F3;
  --primary: #4A6670;
  --accent: #A8B8BC;
  --text: #2E3A3C;
  --muted: #7F8C8D;
  --radius: 16px;
  --font: 'Helvetica Neue', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --shadow: 6px 6px 14px rgba(174, 174, 168, .45), -6px -6px 14px rgba(255, 255, 255, .9);
  --shadow-hover: 8px 8px 20px rgba(174, 174, 168, .55), -8px -8px 20px rgba(255, 255, 255, .95);
  --shadow-inset: inset 3px 3px 8px rgba(174, 174, 168, .4), inset -3px -3px 8px rgba(255, 255, 255, .85);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
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 {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 241, 236, .92);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(174, 174, 168, .18);
}

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

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.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: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: all .25s ease;
}
.nav a:hover { color: var(--primary); background: var(--surface); box-shadow: var(--shadow); }

.search-box {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-inset);
  padding: 4px 6px 4px 14px;
}
.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  width: 130px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: 0;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 9px;
  transition: opacity .25s;
}
.search-box button:hover { opacity: .85; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 28px 0 40px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 21 / 9;
  background: var(--surface);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .8s ease, transform .8s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; transform: scale(1); pointer-events: auto; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(46, 58, 60, .78) 0%, rgba(46, 58, 60, .35) 55%, transparent 100%);
}
.hero-info {
  position: absolute;
  left: 0; bottom: 0;
  z-index: 2;
  padding: 40px;
  max-width: 60%;
  color: #fff;
}
.hero-info h2 { font-size: 30px; font-weight: 800; line-height: 1.25; margin-bottom: 10px; }
.hero-info p { font-size: 14px; color: rgba(255, 255, 255, .82); margin-bottom: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.btn {
  display: inline-block;
  padding: 10px 26px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ---------- Section ---------- */
.sec { margin: 44px 0; }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
}
.sec-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 20px;
  border-radius: 3px;
  background: var(--primary);
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  transition: color .25s;
}
.sec-more:hover { color: var(--primary); }

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

.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 ease;
}
.card:hover .card-cover img { transform: scale(1.05); }

.card-score {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 9px;
  border-radius: 9px;
  background: rgba(74, 102, 112, .92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  box-shadow: 0 2px 6px rgba(46, 58, 60, .3);
}

.card-info { padding: 12px 14px 16px; }
.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  overflow: hidden;
}

/* ---------- Category list ---------- */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cat-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.cat-item .cat-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cat-count { font-size: 12px; color: var(--muted); }

/* ---------- Rank list ---------- */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.rank-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.rank-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
}
.rank-item:nth-child(-n+3) .rank-num { background: var(--primary); color: #fff; box-shadow: none; }
.rank-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rank-score { font-size: 13px; font-weight: 700; color: var(--primary); }

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

.detail-head {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 36px;
  align-items: start;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}
.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

.detail-meta { display: flex; flex-direction: column; gap: 12px; }
.detail-meta h1 { font-size: 26px; font-weight: 800; line-height: 1.3; }
.detail-meta .meta-row { font-size: 14px; color: var(--muted); }
.detail-meta .meta-row strong { color: var(--text); font-weight: 600; }
.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 6px 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.detail-body {
  margin-top: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h2 { font-size: 18px; font-weight: 800; margin: 22px 0 12px; }
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { margin-bottom: 12px; color: #4a5557; }

/* ---------- Tags ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--shadow-inset);
  font-size: 13px;
  color: var(--primary);
  transition: transform .2s ease;
}
.tag:hover { transform: translateY(-2px); }

/* ---------- Pager ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 40px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease;
}
.pg:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.pg.current { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.pg.disabled { opacity: .45; pointer-events: none; }

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 0;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 9px;
  background: var(--surface);
  transition: color .25s, transform .2s;
}
.link-item:hover { color: var(--primary); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 60px;
  padding: 36px 0 44px;
  background: var(--surface);
  box-shadow: 0 -2px 10px rgba(174, 174, 168, .18);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}
.footer a { color: var(--primary); }
.footer a:hover { text-decoration: underline; }

/* ---------- Crumbs ---------- */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 20px 0 4px;
}
.crumbs a { color: var(--muted); transition: color .25s; }
.crumbs a:hover { color: var(--primary); }

/* ---------- Highlight ---------- */
.hl { color: var(--primary); font-weight: 700; background: rgba(168, 184, 188, .28); border-radius: 4px; padding: 0 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(4, 1fr); }
  .detail-head { grid-template-columns: 240px 1fr; gap: 26px; }
}

@media (max-width: 768px) {
  .wrap { padding: 0 16px; }

  .header .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 10px; }
  .logo { font-size: 18px; }
  .nav { order: 3; width: 100%; flex: 0 0 100%; overflow-x: auto; gap: 2px; padding-bottom: 2px; }
  .nav a { padding: 7px 12px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 96px; }

  .hero { aspect-ratio: 4 / 5; margin: 18px 0 28px; }
  .hero-info { max-width: 100%; padding: 22px; }
  .hero-info h2 { font-size: 20px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

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

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

  .cat-list { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .cat-item { padding: 16px 8px; }

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

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

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

  .footer { margin-top: 40px; padding: 26px 0 32px; }
}