:root {
  --bg: #18130F;
  --surface: #241D17;
  --primary: #C9A15A;
  --accent: #B34A32;
  --text: #F2E7D4;
  --muted: #9A8B75;
  --radius: 10px;
  --font-heading: 'Playfair Display', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --line: rgba(201, 161, 90, 0.18);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

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

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

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(201, 161, 90, 0.05), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(179, 74, 50, 0.05), transparent 50%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button, input { font-family: inherit; }

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

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

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

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

.logo img { max-height: 36px; 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: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--primary);
  background: rgba(201, 161, 90, 0.08);
}

.search-box {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.search-box input {
  width: 160px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.search-box input::placeholder { color: var(--muted); }

.search-box button {
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  transition: color 0.2s;
}
.search-box button:hover { color: var(--accent); }

/* ============ Hero ============ */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.hero-slide {
  position: relative;
  min-height: 380px;
  display: none;
}
.hero-slide.active { display: block; }

.hero-slide img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  opacity: 0.55;
}

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 60px 40px 32px;
  background: linear-gradient(to top, rgba(24, 19, 15, 0.96), transparent);
}

.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  color: var(--text);
  margin-bottom: 8px;
}

.hero-info p {
  color: var(--muted);
  font-size: 14px;
  max-width: 640px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 10px 26px;
  background: var(--accent);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 14px;
  letter-spacing: 1px;
  border: 1px solid transparent;
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: #c8553a; transform: translateY(-1px); }

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

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  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;
  background: var(--primary);
  border-radius: 2px;
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  transition: color 0.2s;
}
.sec-more:hover { color: var(--primary); }

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

.card {
  display: flex;
  flex-direction: column;
  background: transparent;
  transition: transform 0.25s;
}
.card:hover { transform: translateY(-4px); }

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.card:hover .card-cover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  background: var(--accent);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  border-radius: 4px 4px 4px 0;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.card-info { padding: 10px 2px 0; }

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}
.card:hover .card-title { color: var(--primary); }

.card-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ Cat list ============ */
.cat-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}
.cat-item:hover { border-color: var(--primary); color: var(--primary); }

.cat-count {
  font-size: 12px;
  color: var(--muted);
}

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

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.rank-num {
  flex-shrink: 0;
  width: 28px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num { color: var(--accent); }

.rank-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}
.rank-item:hover .rank-title { color: var(--primary); }

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

/* ============ Detail ============ */
.detail {
  margin: 32px 0;
}

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

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

.detail-meta { display: flex; flex-direction: column; gap: 10px; }

.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--text);
  letter-spacing: 1px;
}

.detail-meta p { font-size: 14px; color: var(--muted); }
.detail-meta p span { color: var(--text); }

.detail-score {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 14px;
  background: var(--accent);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  border-radius: 4px 4px 4px 0;
}

.detail-body {
  padding: 28px 0;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body p { margin-bottom: 14px; color: var(--muted); }
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--primary);
  margin: 24px 0 12px;
}

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

.tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.2s, border-color 0.2s;
}
.tag:hover { color: var(--primary); border-color: var(--primary); }

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

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s;
}
.pg:hover { color: var(--primary); border-color: var(--primary); }

.pg.current {
  color: var(--bg);
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

.pg.disabled {
  opacity: 0.35;
  pointer-events: none;
}

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

.link-item {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.2s;
}
.link-item:hover { color: var(--primary); }

/* ============ Footer ============ */
.footer {
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}
.footer a { color: var(--muted); transition: color 0.2s; }
.footer a:hover { color: var(--primary); }

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

/* ============ Highlight ============ */
.hl {
  color: var(--accent);
  font-weight: 700;
  font-style: normal;
}

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

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

  .header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 12px;
  }

  .logo { font-size: 19px; }

  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2px;
    padding-bottom: 4px;
  }
  .nav a { padding: 6px 10px; font-size: 13px; }

  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero { margin: 18px 0; }
  .hero-slide { min-height: 260px; }
  .hero-slide img { height: 260px; }
  .hero-info { padding: 40px 20px 20px; }
  .hero-info h2 { font-size: 22px; }
  .hero-info p { font-size: 13px; }

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

  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }

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

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

  .detail-head {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; text-align: center; }
  .detail-meta p { text-align: center; }
  .detail-score { align-self: center; }

  .detail-body { font-size: 14px; }

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