:root {
  --bg: #12110F;
  --surface: #1E1C19;
  --primary: #C43A2F;
  --accent: #E8E0D3;
  --text: #F2EDE4;
  --muted: #8C857A;
  --radius: 10px;
  --font-heading: 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --glass: rgba(30, 28, 25, 0.55);
  --line: rgba(232, 224, 211, 0.12);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(196, 58, 47, 0.06), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(232, 224, 211, 0.04), transparent 45%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--primary); }
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: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  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: 2px;
  color: var(--accent);
  white-space: nowrap;
  position: relative;
  padding-left: 14px;
}

.logo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}

.logo:hover { color: var(--accent); }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  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);
  white-space: nowrap;
  border-radius: 6px;
  transition: all .25s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(196, 58, 47, 0.14);
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(18, 17, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 4px 0 14px;
  height: 38px;
  flex-shrink: 0;
  transition: border-color .25s ease;
}

.search-box:focus-within { border-color: var(--primary); }

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

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

.search-box button {
  border: none;
  background: var(--primary);
  color: var(--accent);
  height: 30px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: opacity .25s ease;
}

.search-box button:hover { opacity: .85; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 28px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  aspect-ratio: 21 / 8;
  min-height: 260px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
}

.hero-slide.active { opacity: 1; }

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 17, 15, 0.95) 5%, rgba(18, 17, 15, 0.2) 60%, transparent);
}

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px 32px;
  max-width: 640px;
}

.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.3;
  margin-bottom: 8px;
}

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

.btn {
  display: inline-block;
  padding: 9px 24px;
  background: var(--primary);
  color: var(--accent);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all .25s ease;
  border: 1px solid transparent;
}

.btn:hover {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-left: 14px;
  position: relative;
}

.sec-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--accent);
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
}

.sec-more:hover { color: var(--primary); }

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

.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .3s ease, border-color .3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(196, 58, 47, 0.5);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--surface);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.card:hover .card-cover img { transform: scale(1.06); }

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(196, 58, 47, 0.92);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: .5px;
}

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

.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  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(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all .25s ease;
}

.cat-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-count {
  font-size: 12px;
  color: var(--muted);
  background: rgba(196, 58, 47, 0.12);
  padding: 1px 8px;
  border-radius: 999px;
}

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

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .25s ease;
}

.rank-item:hover {
  border-color: rgba(196, 58, 47, 0.5);
  transform: translateX(4px);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  min-width: 28px;
  text-align: center;
}

.rank-title {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-score {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

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

.detail-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 28px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

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

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

.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.35;
  color: var(--accent);
}

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

.detail-meta p span { color: var(--text); }

.detail-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.detail-score small { font-size: 13px; color: var(--muted); font-weight: 400; }

.detail-body {
  margin-top: 24px;
  padding: 28px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}

.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}

.detail-body p { margin-bottom: 12px; color: var(--muted); }

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

.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(232, 224, 211, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: all .25s ease;
}

.tag:hover {
  color: var(--accent);
  border-color: var(--primary);
  background: rgba(196, 58, 47, 0.14);
}

/* ---------- 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: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  color: var(--muted);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all .25s ease;
}

.pg:hover { color: var(--primary); border-color: var(--primary); }

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

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

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

.link-item {
  font-size: 13px;
  color: var(--muted);
}

.link-item:hover { color: var(--primary); }

/* ---------- Footer ---------- */
.footer {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  background: rgba(18, 17, 15, 0.6);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 2;
}

.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

/* ---------- Crumbs ---------- */
.crumbs {
  padding: 18px 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

/* ---------- Highlight ---------- */
.hl {
  color: var(--primary);
  font-weight: 600;
  background: rgba(196, 58, 47, 0.12);
  padding: 0 2px;
  border-radius: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .detail-head { grid-template-columns: 200px 1fr; gap: 24px; }
}

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

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }

  .logo { font-size: 19px; }

  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: 2px;
  }

  .nav a { padding: 6px 10px; font-size: 13px; }

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

  .hero { aspect-ratio: 4 / 3; min-height: 220px; margin: 18px auto; }
  .hero-info { padding: 18px; }
  .hero-info h2 { font-size: 19px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

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

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

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

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

  .detail-head {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .detail-cover { max-width: 180px; margin: 0 auto; }
  .detail-meta h1 { font-size: 20px; text-align: center; }
  .detail-score { font-size: 26px; }
  .detail-body { padding: 18px; }

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

  .footer { padding: 24px 0; font-size: 12px; }
}