:root {
  --bg: #F0F4F5;
  --surface: #FFFFFF;
  --primary: #5A7D8C;
  --accent: #F4A259;
  --text: #1F2A33;
  --muted: #7C8B92;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(31, 42, 51, 0.06);
  --shadow-hover: 0 12px 28px rgba(31, 42, 51, 0.12);
  --font: "Inter", "Helvetica Neue", "Noto Sans SC", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  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 { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }

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

/* ===== Header ===== */
.header {
  background: var(--surface);
  border-bottom: 1px solid rgba(90, 125, 140, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.logo img { height: 32px; width: auto; }

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

.nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.nav a:hover,
.nav a.active {
  background: rgba(90, 125, 140, 0.1);
  color: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  flex-shrink: 0;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  width: 150px;
}
.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.search-box button:hover { background: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #5A7D8C 0%, #7C9AA8 50%, #F4A259 100%);
  background-size: 200% 200%;
  animation: heroShift 12s ease infinite;
  min-height: 340px;
}
@keyframes heroShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-slide {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 340px;
  padding: 32px;
  color: #fff;
  background-size: cover;
  background-position: center;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(31, 42, 51, 0.85) 0%, rgba(31, 42, 51, 0.15) 60%, transparent 100%);
}
.hero-info {
  position: relative;
  z-index: 2;
  max-width: 560px;
}
.hero-info h2 {
  font-size: 28px;
  margin-bottom: 8px;
}
.hero-info p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(244, 162, 89, 0.4);
}

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

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.sec-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}
.sec-more:hover { color: var(--primary); }

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

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

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s;
}
.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;
}

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

/* ===== Rank list ===== */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.rank-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-hover);
}
.rank-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--primary);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-item:nth-child(1) .rank-num { background: var(--accent); color: #fff; }
.rank-item:nth-child(2) .rank-num { background: rgba(244, 162, 89, 0.6); color: #fff; }
.rank-item:nth-child(3) .rank-num { background: rgba(244, 162, 89, 0.35); color: #fff; }

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

/* ===== Detail ===== */
.detail {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}
.detail-head {
  display: flex;
  gap: 28px;
  margin-bottom: 28px;
}
.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta {
  flex: 1;
  min-width: 0;
}
.detail-meta h1 {
  font-size: 26px;
  margin-bottom: 12px;
}
.detail-meta p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--muted);
}
.detail-meta p strong { color: var(--text); font-weight: 600; }

.detail-score {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  padding: 4px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.detail-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  border-top: 1px solid rgba(90, 125, 140, 0.12);
  padding-top: 24px;
}
.detail-body h3 {
  font-size: 17px;
  margin: 20px 0 10px;
  color: var(--primary);
}
.detail-body p { margin: 0 0 12px; }

/* ===== Tag list ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  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: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: background 0.2s, color 0.2s;
}
.pg:hover { background: var(--primary); color: #fff; }
.pg.current {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}
.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface);
  transition: color 0.2s, background 0.2s;
}
.link-item:hover {
  color: var(--primary);
  background: rgba(90, 125, 140, 0.1);
}

/* ===== Footer ===== */
.footer {
  background: var(--surface);
  border-top: 1px solid rgba(90, 125, 140, 0.12);
  margin-top: 48px;
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer a { color: var(--primary); }
.footer p { margin: 4px 0; }

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

/* ===== Highlight ===== */
.hl {
  background: rgba(244, 162, 89, 0.35);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}

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

@media (max-width: 768px) {
  .wrap { padding: 0 16px; }

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }
  .nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    padding-bottom: 4px;
  }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero { min-height: 240px; margin: 20px 0; }
  .hero-slide { min-height: 240px; padding: 20px; }
  .hero-info h2 { font-size: 20px; }

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

  .detail { padding: 18px; }
  .detail-head { flex-direction: column; gap: 18px; }
  .detail-cover { width: 160px; }
  .detail-meta h1 { font-size: 20px; }

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