:root {
  --bg: #F7F1E8;
  --surface: #FFFFFF;
  --primary: #FF6B8A;
  --accent: #4ECDC4;
  --text: #2D2A32;
  --muted: #8D8A94;
  --radius: 18px;
  --shadow-sm: 4px 4px 10px rgba(45, 42, 50, 0.08), -4px -4px 10px rgba(255, 255, 255, 0.9);
  --shadow-md: 8px 8px 20px rgba(45, 42, 50, 0.1), -8px -8px 20px rgba(255, 255, 255, 0.95);
  --font-heading: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; 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; }
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 {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 241, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(45, 42, 50, 0.06);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--primary);
  box-shadow: 6px 6px 0 var(--accent);
  transform: rotate(-8deg);
}

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

.nav a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav a:hover,
.nav a.active {
  color: var(--surface);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.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;
  cursor: pointer;
  background: var(--accent);
  color: var(--surface);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  transition: transform 0.15s ease;
}
.search-box button:hover { transform: scale(1.05); }

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

.hero-slide {
  position: relative;
  display: block;
  aspect-ratio: 21 / 9;
  overflow: hidden;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.hero-slide:hover img { transform: scale(1.04); }

.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 32px 28px;
  background: linear-gradient(to top, rgba(45, 42, 50, 0.85), transparent);
  color: #fff;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-info p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--surface);
  background: var(--primary);
  border: none;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(45, 42, 50, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 14px;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 rgba(45, 42, 50, 0.15);
}
.btn.accent { background: var(--accent); }

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

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

.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  position: relative;
  padding-left: 16px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(-8deg);
  width: 8px;
  height: 24px;
  border-radius: 4px;
  background: var(--primary);
  box-shadow: 4px 4px 0 var(--accent);
}

.sec-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease;
}
.sec-more:hover { color: var(--primary); }

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

.card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #ece5da;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-cover img { transform: scale(1.06); }

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(45, 42, 50, 0.25);
  transform: rotate(4deg);
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  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;
}

/* ============ Categories ============ */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.cat-item:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

.cat-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 999px;
}
.cat-item:hover .cat-count { background: rgba(255, 255, 255, 0.3); color: #fff; }

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

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

.rank-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--accent);
  transform: rotate(-6deg);
}
.rank-item:nth-child(1) .rank-num { background: var(--primary); }
.rank-item:nth-child(2) .rank-num { background: #FFB84E; }
.rank-item:nth-child(3) .rank-num { background: #9B8CFF; }

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

.rank-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}

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

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

.detail-cover {
  flex-shrink: 0;
  width: 240px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.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: 28px;
  font-weight: 700;
  margin-bottom: 12px;
}
.detail-meta p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}
.detail-meta p strong { color: var(--text); font-weight: 700; }

.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 4px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  transform: rotate(-2deg);
}

.detail-body {
  margin-top: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  line-height: 1.8;
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 12px;
}
.detail-body p { color: var(--text); font-size: 15px; margin-bottom: 12px; }

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

.tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}
.tag:hover { background: var(--accent); color: #fff; }

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

.pg {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.pg:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }

.pg.current {
  background: var(--primary);
  color: #fff;
  box-shadow: 4px 4px 0 rgba(45, 42, 50, 0.15);
}

.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
}

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

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 14px;
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: color 0.2s ease;
}
.link-item:hover { color: var(--primary); }

/* ============ Footer ============ */
.footer {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 2px solid rgba(45, 42, 50, 0.06);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

/* ============ Crumbs ============ */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  margin: 20px 0;
}
.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(255, 107, 138, 0.12);
  padding: 0 2px;
  border-radius: 4px;
}

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

@media (max-width: 768px) {
  .header .wrap {
    height: 60px;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .logo { font-size: 18px; }
  .nav {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .header .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 100px; }

  .hero-slide { aspect-ratio: 4 / 3; }
  .hero-info { padding: 40px 20px 20px; }
  .hero-info h2 { font-size: 20px; }

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

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

  .detail-head {
    flex-direction: column;
    padding: 20px;
  }
  .detail-cover { width: 100%; max-width: 220px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; }

  .detail-body { padding: 20px; }

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

  .cat-item { padding: 8px 14px; font-size: 13px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-title { font-size: 13px; }
}