:root {
  --bg: #f7f0e3;
  --surface: #fff8ec;
  --primary: #c1532f;
  --accent: #e8a33d;
  --text: #3b2e1f;
  --muted: #8c7a64;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(59, 46, 31, 0.06);
  --shadow-md: 0 6px 20px rgba(59, 46, 31, 0.1);
  --shadow-lg: 0 14px 36px rgba(59, 46, 31, 0.14);
  --font-heading: 'Georgia', 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(rgba(59, 46, 31, 0.035) 1px, transparent 1px);
  background-size: 4px 4px;
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; margin: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #c9a97a; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 240, 227, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(140, 122, 100, 0.16);
  box-shadow: var(--shadow-sm);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.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 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.nav a:hover {
  color: var(--primary);
  background: rgba(232, 163, 61, 0.14);
}

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

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 26px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-slide {
  position: relative;
  aspect-ratio: 21 / 9;
  background: #2a2118;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 36px 32px;
  background: linear-gradient(to top, rgba(30, 22, 14, 0.92), transparent);
  color: #fff8ec;
}
.hero-info h2 {
  font-size: 30px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.hero-info p {
  margin: 0 0 16px;
  font-size: 14px;
  color: rgba(255, 248, 236, 0.78);
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 10px 26px;
  background: var(--primary);
  color: #fff8ec;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(193, 83, 47, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover {
  background: #a8441f;
  color: #fff8ec;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(193, 83, 47, 0.4);
}

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

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.sec-title {
  font-size: 22px;
  color: var(--text);
  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: linear-gradient(var(--accent), var(--primary));
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(140, 122, 100, 0.24);
  transition: all 0.2s ease;
}
.sec-more:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(193, 83, 47, 0.06);
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

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

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(193, 83, 47, 0.92);
  color: #fff8ec;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.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(5, 1fr);
  gap: 16px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  transition: all 0.24s ease;
}
.cat-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--primary);
}

.cat-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: rgba(232, 163, 61, 0.16);
  padding: 2px 10px;
  border-radius: 999px;
}

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

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.24s ease;
}
.rank-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.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;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ===== Detail ===== */
.detail {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 32px;
  margin: 26px 0;
}

.detail-head {
  display: flex;
  gap: 32px;
  margin-bottom: 28px;
}

.detail-cover {
  width: 240px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta { flex: 1; min-width: 0; }
.detail-meta h1 {
  font-size: 28px;
  margin-bottom: 10px;
  line-height: 1.3;
}
.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;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 700;
  color: var(--primary);
  margin: 12px 0;
  line-height: 1;
}

.detail-body {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  padding-top: 24px;
  border-top: 1px dashed rgba(140, 122, 100, 0.28);
}
.detail-body p { margin: 0 0 16px; }
.detail-body h2, .detail-body h3 { margin: 24px 0 12px; }

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

.tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 12px;
  color: var(--primary);
  background: rgba(232, 163, 61, 0.14);
  border-radius: 999px;
  border: 1px solid rgba(232, 163, 61, 0.3);
  transition: all 0.2s ease;
}
.tag:hover {
  background: var(--accent);
  color: #fff8ec;
}

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

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.pg:hover {
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.pg.current {
  background: var(--primary);
  color: #fff8ec;
  box-shadow: 0 6px 16px rgba(193, 83, 47, 0.32);
}
.pg.disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

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

.link-item {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border-radius: 999px;
  border: 1px solid rgba(140, 122, 100, 0.18);
  transition: all 0.2s ease;
}
.link-item:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
  margin-top: 50px;
  padding: 36px 0 28px;
  background: var(--surface);
  border-top: 1px solid rgba(140, 122, 100, 0.16);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 2;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

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

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .cat-list { grid-template-columns: repeat(3, 1fr); }
  .hero-info h2 { font-size: 24px; }
}

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

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }
  .logo { font-size: 19px; }
  .nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .nav a { padding: 5px 12px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 100px; }

  .hero { margin: 16px 0; border-radius: var(--radius-sm); }
  .hero-slide { aspect-ratio: 4 / 3; }
  .hero-info { padding: 40px 18px 20px; }
  .hero-info h2 { font-size: 20px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }
  .btn { padding: 8px 20px; font-size: 13px; }

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

  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .cat-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-item { padding: 12px 14px; font-size: 14px; }

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

  .detail { padding: 20px 16px; border-radius: var(--radius-sm); }
  .detail-head { flex-direction: column; gap: 18px; }
  .detail-cover { width: 100%; max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; text-align: center; }
  .detail-meta p { text-align: center; }
  .detail-score { display: block; text-align: center; font-size: 30px; }

  .pager { gap: 6px; margin: 26px 0; }
  .pg { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
}