:root {
  --bg: #F3EADA;
  --surface: #FBF5EA;
  --primary: #C8354B;
  --accent: #E86A7E;
  --text: #1F1B18;
  --muted: #8A7F74;
  --radius: 18px;
  --shadow-light: -6px -6px 14px rgba(255, 255, 255, 0.85);
  --shadow-dark: 6px 6px 16px rgba(160, 140, 120, 0.35);
  --shadow-soft: 0 8px 24px rgba(160, 140, 120, 0.18);
  --font-heading: 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --font-body: 'PingFang SC', 'Noto Sans SC', Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(200, 53, 75, 0.035) 1px, transparent 1px),
    radial-gradient(rgba(31, 27, 24, 0.04) 1px, transparent 1px);
  background-size: 6px 6px, 11px 11px;
  background-position: 0 0, 3px 5px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

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

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 234, 218, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(31, 27, 24, 0.85);
  box-shadow: 0 4px 14px rgba(160, 140, 120, 0.15);
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 66px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 53, 75, 0.18);
}

.logo:hover {
  color: var(--primary);
}

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

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

.nav a {
  position: relative;
  padding: 6px 12px;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav a:hover {
  color: var(--primary);
  background: rgba(200, 53, 75, 0.08);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  box-shadow: inset 2px 2px 5px rgba(160, 140, 120, 0.25),
              inset -2px -2px 5px rgba(255, 255, 255, 0.9);
}

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

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

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

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

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 26px 0 8px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  min-height: 320px;
}

.hero-slide {
  position: relative;
  display: none;
  aspect-ratio: 21 / 9;
  min-height: 320px;
  animation: heroFade 0.7s ease both;
}

.hero-slide:first-child {
  display: block;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(31, 27, 24, 0.82) 0%, rgba(31, 27, 24, 0.45) 45%, rgba(31, 27, 24, 0.05) 100%);
}

.hero-info {
  position: relative;
  z-index: 2;
  max-width: 560px;
  padding: 42px 40px;
  color: #FBF5EA;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  justify-content: flex-end;
}

.hero-info h2 {
  font-size: 30px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

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

@keyframes heroFade {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  align-self: flex-start;
  box-shadow: 0 6px 16px rgba(200, 53, 75, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

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

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid rgba(31, 27, 24, 0.85);
  padding-bottom: 10px;
  margin-bottom: 22px;
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  position: relative;
  padding-left: 14px;
}

.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: var(--primary);
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.sec-more:hover {
  color: var(--primary);
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: -8px -8px 18px rgba(255, 255, 255, 0.9),
              10px 10px 26px rgba(160, 140, 120, 0.42);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e6dccb;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(200, 53, 75, 0.4);
}

.card-info {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

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

/* ---------- Categories ---------- */
.cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: 14px;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s ease, color 0.2s ease;
}

.cat-item:hover {
  transform: translateY(-3px);
  color: var(--primary);
}

.cat-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: rgba(200, 53, 75, 0.08);
  padding: 1px 8px;
  border-radius: 999px;
}

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

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: transform 0.2s ease;
}

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

.rank-num {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}

.rank-item:nth-child(-n+3) .rank-num {
  background: var(--accent);
}

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

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

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

.detail-head {
  display: flex;
  gap: 30px;
  padding: 26px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  margin-bottom: 26px;
}

.detail-cover {
  flex: none;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #e6dccb;
}

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

.detail-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-meta h1 {
  font-size: 26px;
  line-height: 1.35;
}

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

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.detail-score::before {
  content: "★";
  font-size: 18px;
  color: var(--accent);
}

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

.detail-body p {
  margin: 0 0 14px;
}

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 1px 1px 3px rgba(160, 140, 120, 0.25),
              inset -1px -1px 3px rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease, background 0.2s ease;
}

.tag:hover {
  color: #fff;
  background: var(--primary);
}

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

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: color 0.2s ease, transform 0.2s ease;
}

.pg:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.pg.current {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(200, 53, 75, 0.35);
}

.pg.disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 20px 0;
}

.link-item {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s ease;
}

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

/* ---------- Crumbs ---------- */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 18px 0 0;
  line-height: 1.8;
}

.crumbs a {
  color: var(--muted);
}

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

/* ---------- Highlight ---------- */
.hl {
  color: var(--primary);
  font-weight: 700;
  background: rgba(232, 106, 126, 0.16);
  border-radius: 4px;
  padding: 0 2px;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 50px;
  padding: 30px 0 40px;
  border-top: 2px solid rgba(31, 27, 24, 0.85);
  background: rgba(251, 245, 234, 0.6);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.9;
}

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

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

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

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  .wrap {
    padding: 0 14px;
  }
  .header .wrap {
    gap: 10px;
    min-height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo {
    font-size: 20px;
  }
  .nav {
    order: 3;
    width: 100%;
    flex: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    border-top: 1px dashed rgba(31, 27, 24, 0.2);
    margin-top: 4px;
  }
  .nav a {
    padding: 6px 10px;
    font-size: 14px;
  }
  .search-box {
    flex: 1;
    min-width: 0;
  }
  .search-box input {
    width: 100%;
    min-width: 0;
  }
  .hero {
    margin-top: 16px;
    min-height: 240px;
  }
  .hero-slide {
    aspect-ratio: 4 / 3;
    min-height: 240px;
  }
  .hero-slide::after {
    background: linear-gradient(0deg, rgba(31, 27, 24, 0.88) 0%, rgba(31, 27, 24, 0.35) 60%, rgba(31, 27, 24, 0.05) 100%);
  }
  .hero-info {
    padding: 22px 20px;
    max-width: 100%;
  }
  .hero-info h2 {
    font-size: 21px;
  }
  .hero-info p {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
  .sec {
    margin: 28px 0;
  }
  .sec-title {
    font-size: 18px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card-info {
    padding: 10px 10px 12px;
  }
  .card-title {
    font-size: 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: 8px;
  }
  .detail-head {
    flex-direction: column;
    gap: 18px;
    padding: 18px;
  }
  .detail-cover {
    width: 140px;
    margin: 0 auto;
  }
  .detail-meta h1 {
    font-size: 20px;
    text-align: center;
  }
  .detail-meta p {
    text-align: center;
  }
  .detail-meta .btn {
    align-self: center;
  }
  .detail-score {
    justify-content: center;
    font-size: 19px;
  }
  .detail-body {
    padding: 18px;
    font-size: 14px;
  }
  .pg {
    min-width: 34px;
    height: 34px;
    font-size: 13px;
    border-radius: 10px;
  }
  .footer {
    margin-top: 34px;
    padding: 22px 0 30px;
  }
}

@media (max-width: 400px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .cat-list {
    grid-template-columns: 1fr;
  }
}