:root {
  --bg: #F7F9F2;
  --surface: #FFFFFF;
  --primary: #8FCB2C;
  --accent: #5A9E1F;
  --text: #1F2A1B;
  --muted: #7C8874;
  --radius: 14px;
  --line: #E4EAD9;
  --font-head: 'Helvetica Neue', 'PingFang SC', 'Noto Sans SC', sans-serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --shadow: 0 2px 10px rgba(31, 42, 27, 0.05);
  --shadow-hover: 0 10px 26px rgba(90, 158, 31, 0.16);
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(31, 42, 27, 0.035) 1px, transparent 1px),
    radial-gradient(rgba(143, 203, 44, 0.05) 1px, transparent 1px);
  background-size: 18px 18px, 26px 26px;
  background-position: 0 0, 9px 13px;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.3; }
ul, ol { list-style: none; margin: 0; padding: 0; }

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

/* ============ Header ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 249, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

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

.logo {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(143, 203, 44, 0.2);
}
.logo img { height: 30px; width: auto; }

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

.nav a {
  position: relative;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 8px;
  transition: color 0.2s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { transform: scaleX(1); }

.search-box {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 4px 4px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(143, 203, 44, 0.18);
}
.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  width: 150px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: 0;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-body);
  transition: background 0.2s;
}
.search-box button:hover { background: var(--accent); }

/* ============ Hero ============ */
.hero {
  position: relative;
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.hero-slide {
  display: none;
  position: relative;
  aspect-ratio: 21 / 9;
  min-height: 220px;
}
.hero-slide:first-child { display: block; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 32px 26px;
  background: linear-gradient(to top, rgba(31, 42, 27, 0.85), rgba(31, 42, 27, 0));
  color: #fff;
}
.hero-info h2 {
  font-size: 26px;
  margin-bottom: 8px;
}
.hero-info p {
  margin: 0 0 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  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: 9px 22px;
  font-size: 14px;
  font-family: var(--font-body);
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(90, 158, 31, 0.3);
}

/* ============ Section ============ */
.sec { margin: 36px 0; }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.sec-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
  white-space: nowrap;
}
.sec-more:hover { color: var(--accent); }

/* ============ Grid & Card ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

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

.card-score {
  position: absolute;
  top: 8px;
  right: 0;
  padding: 3px 12px 3px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-head);
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
  letter-spacing: 0.5px;
}

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}
.card:hover .card-title { color: var(--accent); }

.card-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ Category list ============ */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.cat-item:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.cat-item span:first-child {
  font-size: 14px;
  font-weight: 600;
}
.cat-count {
  font-size: 12px;
  color: var(--muted);
}

/* ============ Rank list ============ */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.rank-item:hover { border-color: var(--primary); background: #FBFDF6; }

.rank-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 8px;
  background: #F0F4E7;
}
.rank-item:nth-child(-n+3) .rank-num {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.rank-title {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  flex-shrink: 0;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ============ Detail ============ */
.detail {
  margin: 28px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.detail-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: #EEF3E4;
  border: 1px solid var(--line);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta { display: flex; flex-direction: column; gap: 10px; }
.detail-meta h1 { font-size: 26px; }
.detail-meta p { margin: 0; font-size: 14px; color: var(--muted); }
.detail-meta p strong { color: var(--text); font-weight: 600; margin-right: 6px; }

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 14px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(143, 203, 44, 0.14);
  border: 1px solid rgba(143, 203, 44, 0.4);
}

.detail-body {
  padding-top: 22px;
  font-size: 15px;
  line-height: 1.9;
  color: #3A4634;
}
.detail-body h2, .detail-body h3 {
  font-size: 17px;
  margin: 22px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.detail-body p { margin: 0 0 14px; }
.detail-body img { border-radius: 10px; margin: 12px 0; }

/* ============ Tags ============ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--accent);
  background: rgba(143, 203, 44, 0.1);
  border: 1px solid rgba(143, 203, 44, 0.35);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.tag:hover { background: var(--primary); color: #fff; }

/* ============ Pager ============ */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 32px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pg:hover { border-color: var(--primary); color: var(--accent); }
.pg.current {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
}
.pg.disabled {
  color: #C3CBB8;
  background: #F2F5EC;
  border-color: var(--line);
  pointer-events: none;
}

/* ============ Links ============ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}
.link-item:hover { color: var(--accent); }

/* ============ Footer ============ */
.footer {
  margin-top: 48px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}
.footer a { color: var(--muted); transition: color 0.2s; }
.footer a:hover { color: var(--accent); }

/* ============ Crumbs ============ */
.crumbs {
  margin: 20px 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); transition: color 0.2s; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 6px; color: #C3CBB8; }

/* ============ Highlight ============ */
.hl {
  color: var(--accent);
  background: rgba(143, 203, 44, 0.18);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

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

@media (max-width: 768px) {
  body { font-size: 14px; }

  .wrap { padding: 0 14px; }

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo { font-size: 18px; }
  .nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero { margin: 16px 0; }
  .hero-slide { aspect-ratio: 16 / 10; }
  .hero-info { padding: 28px 18px 18px; }
  .hero-info h2 { font-size: 19px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

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

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

  .cat-list { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-item { padding: 14px 8px; }

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

  .detail { padding: 16px; margin: 18px 0; }
  .detail-head {
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding-bottom: 18px;
  }
  .detail-meta h1 { font-size: 19px; }
  .detail-meta p { font-size: 13px; }
  .detail-body { font-size: 14px; padding-top: 16px; }

  .pg { min-width: 32px; height: 32px; padding: 0 9px; font-size: 13px; }

  .links { padding: 14px; gap: 8px 14px; }
  .footer { margin-top: 32px; padding: 20px 0; font-size: 12px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-list { grid-template-columns: repeat(2, 1fr); }
  .detail-head { grid-template-columns: 100px 1fr; }
}