:root {
  --bg: #FBF0E4;
  --surface: #FFF6EC;
  --primary: #E8354D;
  --accent: #F5B93B;
  --text: #2E2430;
  --muted: #8E7E85;
  --radius: 18px;
  --font-heading: 'Avenir Next','PingFang SC','Hiragino Sans GB',sans-serif;
  --font-body: 'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;
  --shadow: 0 6px 18px rgba(46,36,48,.10), 0 2px 6px rgba(46,36,48,.06);
  --shadow-hover: 0 14px 30px rgba(46,36,48,.16), 0 4px 10px rgba(46,36,48,.08);
  --border: 2px solid var(--text);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  margin: 0;
  letter-spacing: .5px;
}

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

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: var(--border);
  box-shadow: 0 4px 14px rgba(46,36,48,.06);
}

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

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

.logo::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 18px 0 0 -3px var(--accent);
  margin-right: 20px;
}

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

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

.nav a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
  color: var(--text);
  transition: background .2s, color .2s, transform .2s;
}

.nav a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px) rotate(-1.5deg);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  flex-shrink: 0;
  transition: box-shadow .2s;
}

.search-box:focus-within { box-shadow: 0 0 0 4px rgba(232,53,77,.15); }

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  width: 140px;
}

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

.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s;
}

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 21 / 8;
  min-height: 220px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
  background-size: cover;
  background-position: center;
}

.hero-slide:first-child,
.hero-slide.active { opacity: 1; }

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(46,36,48,.78) 0%, rgba(46,36,48,.35) 45%, rgba(46,36,48,0) 100%);
}

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 32px;
  max-width: 60%;
  color: #fff;
}

.hero-info h2 {
  font-size: 28px;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.hero-info p {
  margin: 0 0 16px;
  font-size: 14px;
  color: rgba(255,255,255,.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border: var(--border);
  box-shadow: 0 4px 0 var(--text);
  transition: transform .15s, box-shadow .15s, background .2s;
}

.btn:hover {
  background: var(--accent);
  color: var(--text);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--text);
}

/* ---------- Sections ---------- */
.sec {
  margin: 40px 0;
}

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.sec-title {
  font-size: 22px;
  font-weight: 500;
  position: relative;
  padding-left: 16px;
}

.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  width: 8px;
  height: 26px;
  border-radius: 4px;
  background: var(--primary);
  box-shadow: 4px 2px 0 var(--accent);
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--muted);
  transition: all .2s;
}

.sec-more:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateX(3px);
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  position: relative;
}

.card:hover {
  transform: translateY(-6px) rotate(-1deg);
  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;
}

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

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--text);
  box-shadow: 2px 2px 0 var(--text);
  z-index: 2;
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Cat list ---------- */
.cat-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.cat-item {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .2s, box-shadow .2s;
}

.cat-item:nth-child(odd) { transform: rotate(-1deg); }
.cat-item:nth-child(even) { transform: rotate(1deg); }

.cat-item:hover {
  transform: translateY(-5px) rotate(0);
  box-shadow: var(--shadow-hover);
}

.cat-item strong {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 500;
}

.cat-count {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

/* ---------- 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);
  transition: transform .2s, box-shadow .2s;
}

.rank-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 600;
  color: var(--primary);
  min-width: 42px;
  text-align: center;
  line-height: 1;
  text-shadow: 2px 2px 0 var(--accent);
}

.rank-item:nth-child(1) .rank-num { color: var(--accent); text-shadow: 2px 2px 0 var(--primary); }

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

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

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

.detail-head {
  display: flex;
  gap: 30px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  align-items: flex-start;
}

.detail-cover {
  width: 220px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
  box-shadow: 6px 6px 0 var(--accent);
}

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

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

.detail-meta h1 {
  font-size: 26px;
  margin-bottom: 12px;
  line-height: 1.3;
}

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

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

.detail-score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  color: var(--primary);
  margin: 10px 0;
}

.detail-score small {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.detail-body {
  margin-top: 26px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  line-height: 1.9;
  font-size: 15px;
}

.detail-body h2 {
  font-size: 18px;
  margin: 18px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.detail-body p { margin: 10px 0; color: var(--text); }

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tag {
  display: inline-block;
  padding: 5px 14px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1.5px solid var(--text);
  color: var(--text);
  transition: all .2s;
}

.tag:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px) rotate(-2deg);
}

/* ---------- Pager ---------- */
.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  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);
  border: var(--border);
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 3px 0 var(--text);
  transition: transform .15s, box-shadow .15s, background .2s;
}

.pg:hover {
  background: var(--accent);
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--text);
}

.pg.current {
  background: var(--primary);
  color: #fff;
}

.pg.disabled {
  opacity: .45;
  pointer-events: none;
  box-shadow: none;
  transform: translateY(2px);
}

/* ---------- Links & Footer ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 30px 0;
}

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(142,126,133,.35);
  transition: all .2s;
}

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

.footer {
  margin-top: 50px;
  padding: 30px 0 36px;
  background: var(--surface);
  border-top: var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}

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

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

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

/* ---------- Highlight ---------- */
.hl {
  color: var(--primary);
  font-weight: 600;
  background: rgba(245,185,59,.35);
  border-radius: 4px;
  padding: 0 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cat-list { grid-template-columns: repeat(3, 1fr); }
}

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

  .header .wrap {
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .logo { font-size: 19px; }

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

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

  .search-box { flex: 1; min-width: 0; }
  .search-box input { width: 100%; }

  .hero {
    aspect-ratio: 4 / 3;
    margin: 20px 0;
  }

  .hero-info {
    max-width: 100%;
    padding: 20px;
  }

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

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

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

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

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

  .detail-meta h1 { font-size: 20px; }
  .detail-body { padding: 18px; }

  .card-info { padding: 10px 11px 12px; }
  .card-title { font-size: 14px; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-list { grid-template-columns: 1fr 1fr; }
  .rank-num { font-size: 22px; min-width: 34px; }
}