:root {
  --bg: #F4F1EA;
  --surface: #FBF8F2;
  --primary: #5B7B8C;
  --accent: #C44536;
  --text: #2A3238;
  --muted: #7E8B93;
  --radius: 12px;
  --border: 2px solid #2A3238;
  --font-heading: 'Trebuchet MS', 'Segoe UI', 'PingFang SC', sans-serif;
  --font-body: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  background-image:
    radial-gradient(rgba(42,50,56,.035) 1px, transparent 1px),
    radial-gradient(rgba(42,50,56,.025) 1px, transparent 1px);
  background-size: 6px 6px, 11px 11px;
  background-position: 0 0, 3px 5px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

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

/* ============ Header ============ */
.header {
  background: var(--surface);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 66px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo::before {
  content: "";
  width: 12px;
  height: 22px;
  background: var(--accent);
  border-radius: 3px;
  transform: rotate(-8deg);
  display: inline-block;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav a:hover {
  background: var(--primary);
  color: #fff;
}
.search-box {
  display: flex;
  align-items: center;
  border: var(--border);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.search-box input {
  border: 0;
  outline: 0;
  padding: 8px 14px;
  font-size: 14px;
  width: 150px;
  background: transparent;
  font-family: var(--font-body);
  color: var(--text);
}
.search-box button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .2s;
}
.search-box button:hover { opacity: .85; }

/* ============ Hero ============ */
.hero {
  margin: 24px 0;
  position: relative;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.hero-slide {
  position: relative;
  display: none;
}
.hero-slide.active,
.hero-slide:first-child { display: block; }
.hero-slide img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
}
.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 32px 28px;
  background: linear-gradient(to top, rgba(42,50,56,.92), rgba(42,50,56,0));
  color: #fff;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-bottom: 8px;
}
.hero-info p {
  font-size: 14px;
  color: rgba(255,255,255,.82);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn {
  display: inline-block;
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid var(--accent);
  transition: transform .2s, background .2s;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px) rotate(-1deg);
  background: #a83a2d;
  border-color: #a83a2d;
}

/* ============ Section ============ */
.sec { margin: 36px 0; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 2px dashed rgba(42,50,56,.18);
  padding-bottom: 10px;
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background: var(--accent);
  border-radius: 3px;
  transform: rotate(6deg);
}
.sec-more {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}
.sec-more:hover { color: var(--accent); }

/* ============ Grid & Card ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .22s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-5px) rotate(-1deg);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e6e1d6;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.card:hover .card-cover img { transform: scale(1.05); }
.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid #fff;
}
.card-info {
  padding: 10px 10px 12px;
}
.card-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ Cat list ============ */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.cat-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: transform .2s, background .2s, color .2s;
}
.cat-item:nth-child(odd) { transform: rotate(-1.5deg); }
.cat-item:nth-child(even) { transform: rotate(1.5deg); }
.cat-item:hover {
  background: var(--primary);
  color: #fff;
  transform: rotate(0) translateY(-3px);
}
.cat-count {
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 700;
}

/* ============ Rank list ============ */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  transition: transform .2s;
}
.rank-item:hover { transform: translateX(4px); }
.rank-num {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  min-width: 38px;
  text-align: center;
  line-height: 1;
}
.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num {
  color: var(--primary);
}
.rank-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ============ Detail ============ */
.detail {
  margin: 24px 0;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.detail-head {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}
.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
  background: #e6e1d6;
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.3;
}
.detail-meta p {
  font-size: 14px;
  color: var(--muted);
}
.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 4px 16px;
  border-radius: 999px;
  align-self: flex-start;
}
.detail-body {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  border-top: 2px dashed rgba(42,50,56,.18);
  padding-top: 20px;
}
.detail-body p { margin-bottom: 12px; }

/* ============ Tag list ============ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  background: var(--bg);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.tag:hover {
  background: var(--primary);
  color: #fff;
}

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

/* ============ Links ============ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 0;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border: 1.5px dashed rgba(42,50,56,.25);
  border-radius: 999px;
  transition: color .2s, border-color .2s;
}
.link-item:hover {
  color: var(--accent);
  border-color: var(--accent);
}

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

/* ============ Crumbs ============ */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 0;
}
.crumbs a { color: var(--primary); }
.crumbs a:hover { color: var(--accent); }

/* ============ Highlight ============ */
.hl {
  background: rgba(196,69,54,.18);
  color: var(--accent);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 3px;
}

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

@media (max-width: 768px) {
  .wrap { padding: 0 14px; }
  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo { font-size: 19px; }
  .nav {
    order: 3;
    width: 100%;
    flex: none;
    padding-bottom: 4px;
  }
  .nav a { padding: 5px 10px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero-slide img { height: 220px; }
  .hero-info { padding: 24px 18px 18px; }
  .hero-info h2 { font-size: 20px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

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

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

  .cat-item { font-size: 13px; padding: 6px 12px; }

  .detail { padding: 16px; }
  .detail-head { flex-direction: column; gap: 16px; }
  .detail-cover { width: 140px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; }

  .rank-num { font-size: 22px; min-width: 32px; }
  .rank-title { font-size: 13px; }

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