:root {
  --bg: #F6F2E8;
  --surface: #FFFDF7;
  --primary: #E23A2E;
  --accent: #2E6F9E;
  --text: #2A2723;
  --muted: #8B8578;
  --ink: #2A2723;
  --radius: 14px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --border: 2px solid var(--ink);
  --font-head: "Songti SC", "Noto Serif SC", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(42,39,35,.04) 1px, transparent 1px);
  background-size: 6px 6px;
  color: var(--text);
  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 {
  background: var(--surface);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.logo {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  position: relative;
  padding: 2px 10px;
  background: var(--primary);
  color: #fff;
  border: var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
}
.logo:hover { transform: rotate(0deg); }
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  color: var(--text);
  transition: all .15s;
}
.nav a:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px) rotate(-1deg);
}
.search-box {
  display: flex;
  align-items: center;
  border: var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.search-box input {
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 14px;
  width: 160px;
  background: transparent;
  font-family: var(--font-body);
  color: var(--text);
}
.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-body);
}
.search-box button:hover { background: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 28px 0;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-slide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 320px;
}
.hero-slide:nth-child(even) { direction: rtl; }
.hero-slide:nth-child(even) > * { direction: ltr; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 320px;
}
.hero-info {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.hero-info h2 {
  font-family: var(--font-head);
  font-size: 30px;
  line-height: 1.25;
  color: var(--ink);
}
.hero-info p {
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn {
  display: inline-block;
  align-self: flex-start;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all .15s;
  cursor: pointer;
}
.btn:hover {
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--accent);
}

/* ---------- Section ---------- */
.sec { margin: 40px 0; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: var(--border);
  padding-bottom: 10px;
}
.sec-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  padding-left: 16px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(8deg);
  width: 8px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}
.sec-more {
  font-size: 14px;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}
.sec-more:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- Grid & Card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translate(-3px, -3px) rotate(-.6deg);
  box-shadow: 6px 6px 0 var(--ink);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-bottom: var(--border);
  background: var(--bg);
}
.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(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  transform: rotate(3deg);
}
.card-info { padding: 10px 12px 12px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  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: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  transition: all .15s;
}
.cat-item:hover {
  background: var(--accent);
  color: #fff;
  transform: translate(-2px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 var(--ink);
}
.cat-count {
  font-size: 13px;
  font-family: var(--font-body);
  background: var(--primary);
  color: #fff;
  padding: 1px 9px;
  border-radius: 999px;
  border: 2px solid var(--ink);
}

/* ---------- 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: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all .15s;
}
.rank-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}
.rank-num {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transform: rotate(-6deg);
}
.rank-item:nth-child(1) .rank-num { background: var(--primary); }
.rank-item:nth-child(2) .rank-num { background: var(--primary); }
.rank-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-score {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* ---------- Detail ---------- */
.detail { margin: 28px 0; }
.detail-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 28px;
}
.detail-cover {
  aspect-ratio: 2 / 3;
  border: var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta { display: flex; flex-direction: column; gap: 14px; }
.detail-meta h1 {
  font-family: var(--font-head);
  font-size: 28px;
  line-height: 1.3;
  color: var(--ink);
}
.detail-meta p { font-size: 14px; color: var(--muted); }
.detail-score {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 2px 16px;
  border: var(--border);
  border-radius: 10px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-sm);
}
.detail-body {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h2 {
  font-family: var(--font-head);
  font-size: 20px;
  margin: 20px 0 10px;
  color: var(--ink);
}
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { margin-bottom: 12px; }

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tag {
  font-size: 13px;
  padding: 3px 12px;
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--text);
  transition: all .15s;
}
.tag:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(-2deg);
}

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

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
}
.link-item {
  font-size: 13px;
  padding: 4px 12px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 8px;
  color: var(--muted);
  transition: all .15s;
}
.link-item:hover {
  background: var(--accent);
  color: #fff;
  transform: rotate(-1deg);
}

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

/* ---------- Highlight ---------- */
.hl {
  background: var(--primary);
  color: #fff;
  padding: 0 3px;
  border-radius: 3px;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .wrap { padding: 0 14px; }
  .header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .logo { font-size: 20px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero-slide {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero-slide:nth-child(even) { direction: ltr; }
  .hero-slide img { min-height: 200px; max-height: 240px; }
  .hero-info { padding: 20px 18px; }
  .hero-info h2 { font-size: 22px; }

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

  .detail-head {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 18px;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; }
  .detail-body { padding: 18px; }

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