:root {
  --bg: #F4F1EA;
  --surface: #FFFFFF;
  --primary: #1C1B19;
  --accent: #C23B22;
  --text: #2A2824;
  --muted: #8C877D;
  --radius: 4px;
  --font-heading: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-body: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --line: #1C1B19;
  --line-soft: #D9D4C8;
  --shadow: 0 2px 6px rgba(28,27,25,0.06);
  --shadow-hover: 0 8px 20px rgba(28,27,25,0.14);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--primary);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

/* ===== Header ===== */
.header {
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  line-height: 1.1;
}

.logo img { height: 32px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  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(--text);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

.nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

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

.search-box input {
  border: 0;
  background: transparent;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
  width: 150px;
}

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

.search-box button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background .2s;
}

.search-box button:hover { background: var(--accent); }

/* ===== Hero 轮播 ===== */
.hero {
  position: relative;
  margin: 24px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--primary);
  aspect-ratio: 21 / 8;
}

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

.hero-slide:first-child,
.hero-slide.active { opacity: 1; }

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 6s ease;
}

.hero-slide.active img { transform: scale(1.06); }

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(28,27,25,0.85) 0%, rgba(28,27,25,0.35) 55%, rgba(28,27,25,0) 100%);
}

.hero-info {
  position: absolute;
  left: 40px;
  bottom: 40px;
  z-index: 2;
  max-width: 55%;
  color: #fff;
}

.hero-info h2 {
  color: #fff;
  font-size: 30px;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero-info p {
  margin: 0 0 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  font-family: var(--font-body);
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
}

.btn:hover {
  background: #a82f1a;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn.ghost {
  background: transparent;
  border-color: #fff;
  color: #fff;
}

.btn.ghost:hover { background: rgba(255,255,255,0.15); }

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

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

.sec-title {
  font-size: 22px;
  position: relative;
  padding-left: 14px;
  line-height: 1.2;
}

.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 20px;
  background: var(--accent);
  border-radius: 1px;
}

.sec-more {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .2s;
}

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

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

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #e8e4da;
}

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

.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 7px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  z-index: 2;
}

.card-info {
  padding: 9px 10px 11px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

/* ===== 分类列表 ===== */
.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 8px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}

.cat-item:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.cat-item span:first-child,
.cat-item .cat-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

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

/* ===== 排行榜 ===== */
.rank-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .2s;
}

.rank-item:hover { background: var(--surface); }

.rank-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.rank-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item:hover .rank-title { color: var(--accent); }

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

/* ===== 详情页 ===== */
.detail { margin: 28px 0; }

.detail-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

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

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

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

.detail-meta h1 {
  font-size: 28px;
  line-height: 1.3;
}

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

.detail-meta p b { color: var(--muted); font-weight: 400; }

.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.detail-body {
  margin-top: 24px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}

.detail-body h3 {
  font-size: 18px;
  margin: 20px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.detail-body p { margin: 0 0 14px; }

/* ===== 标签 ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color .2s, color .2s;
}

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

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

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: border-color .2s, color .2s, background .2s;
}

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

.pg.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.pg.disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--line-soft);
  pointer-events: none;
  opacity: .6;
}

/* ===== 友情链接 ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
}

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

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

/* ===== 面包屑 ===== */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 0;
}

.crumbs a { color: var(--muted); transition: color .2s; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--text); }

/* ===== 搜索高亮 ===== */
.hl {
  color: var(--accent);
  font-weight: 700;
  background: transparent;
  border-bottom: 2px solid var(--accent);
  padding: 0 1px;
}

/* ===== Footer ===== */
.footer {
  margin-top: 48px;
  padding: 30px 0;
  background: var(--primary);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  border-top: 4px solid var(--accent);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.footer a { color: rgba(255,255,255,0.7); transition: color .2s; }
.footer a:hover { color: #fff; }
.footer p { margin: 0; }

/* ===== 响应式 ===== */
@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 14px; }

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

  .logo { font-size: 19px; }

  .nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    border-top: 1px solid var(--line-soft);
    padding-top: 6px;
  }

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

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

  .hero {
    aspect-ratio: 4 / 3;
    margin: 16px auto;
  }

  .hero-info {
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: none;
  }

  .hero-info h2 { font-size: 20px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

  .sec { margin: 26px 0; }
  .sec-title { font-size: 18px; }
  .sec-more { font-size: 12px; }

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

  .card-info { padding: 7px 8px 9px; }
  .card-title { font-size: 13px; }
  .card-meta { font-size: 11px; }

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

  .rank-item { padding: 10px 6px; gap: 10px; }
  .rank-title { font-size: 14px; }

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

  .detail-cover {
    max-width: 200px;
    margin: 0 auto;
  }

  .detail-meta h1 { font-size: 22px; }
  .detail-body { padding: 16px; font-size: 14px; }

  .footer .wrap { flex-direction: column; gap: 8px; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-list { grid-template-columns: repeat(2, 1fr); }
  .search-box input { width: 80px; }
}