:root {
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --primary: #5A5A5A;
  --accent: #C43A2F;
  --text: #2B2B2B;
  --muted: #8A8A8A;
  --radius: 12px;
  --font-heading: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --font-body: 'Courier New', 'Noto Sans SC', 'PingFang SC', sans-serif;
  --line: rgba(90, 90, 90, 0.15);
  --shadow-sm: 0 2px 8px rgba(43, 43, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(43, 43, 43, 0.12);
  --shadow-lg: 0 16px 40px rgba(43, 43, 43, 0.18);
}

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

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

body {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg, rgba(90, 90, 90, 0.025) 0, rgba(90, 90, 90, 0.025) 1px, transparent 1px, transparent 3px),
    radial-gradient(circle at 20% 0%, rgba(196, 58, 47, 0.04), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.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(--text);
  white-space: nowrap;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.logo::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(196, 58, 47, 0.15);
}

.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(--primary);
  white-space: nowrap;
  border-radius: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav a:hover {
  color: var(--accent);
  background: rgba(196, 58, 47, 0.06);
  border-bottom-color: var(--accent);
}

.search-box {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  overflow: hidden;
  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(196, 58, 47, 0.1);
}

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

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

.search-box button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

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

/* ===== Hero 轮播 ===== */
.hero {
  position: relative;
  margin: 24px auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--primary);
  box-shadow: var(--shadow-md);
}

.hero-slide {
  position: relative;
  display: block;
  aspect-ratio: 21 / 9;
  overflow: hidden;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-slide:hover img {
  transform: scale(1.04);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(196, 58, 47, 0.06) 0, rgba(196, 58, 47, 0.06) 1px, transparent 1px, transparent 4px),
    linear-gradient(180deg, transparent 30%, rgba(43, 43, 43, 0.85) 100%);
  pointer-events: none;
}

.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 32px;
  color: #fff;
}

.hero-info h2 {
  font-size: 28px;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero-info p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  max-width: 640px;
  margin-bottom: 16px;
  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-family: var(--font-body);
  font-size: 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(196, 58, 47, 0.35);
}

.btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(196, 58, 47, 0.45);
}

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

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

.sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 48px;
  height: 2px;
  background: var(--accent);
}

.sec-title {
  font-size: 22px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
}

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

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

.sec-more::after {
  content: " →";
}

/* ===== Grid 卡片 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

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

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e4dc, #d6d2ca);
}

.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: 8px;
  right: 8px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(196, 58, 47, 0.4);
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  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 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text);
}

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

.cat-count {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  background: rgba(196, 58, 47, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
}

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

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--muted);
  min-width: 40px;
  text-align: center;
  line-height: 1;
}

.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);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.detail-head {
  display: flex;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}

.detail-cover {
  flex-shrink: 0;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  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: 12px;
  color: var(--text);
}

.detail-meta p {
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 6px;
}

.detail-meta p span {
  color: var(--muted);
  display: inline-block;
  min-width: 56px;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
  padding: 6px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(196, 58, 47, 0.3);
}

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

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

.detail-body p {
  margin-bottom: 12px;
}

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

.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--primary);
  background: rgba(90, 90, 90, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: all 0.2s ease;
}

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

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

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

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

.pg.current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(196, 58, 47, 0.3);
}

.pg.disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

/* ===== 友情链接 ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 20px 0;
}

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

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

/* ===== Footer ===== */
.footer {
  margin-top: 48px;
  padding: 32px 0 24px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}

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

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

/* ===== 面包屑 ===== */
.crumbs {
  padding: 16px 0;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.crumbs span {
  margin: 0 6px;
  color: var(--muted);
}

/* ===== 搜索高亮 ===== */
.hl {
  color: var(--accent);
  font-weight: 700;
  background: rgba(196, 58, 47, 0.08);
  padding: 0 2px;
  border-radius: 3px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .wrap {
    padding: 0 14px;
  }

  .header .wrap {
    height: 56px;
    gap: 12px;
    flex-wrap: nowrap;
  }

  .logo {
    font-size: 18px;
  }

  .nav {
    gap: 2px;
  }

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

  .search-box {
    display: none;
  }

  .hero {
    margin: 16px auto;
    border-radius: 10px;
  }

  .hero-slide {
    aspect-ratio: 16 / 10;
  }

  .hero-info {
    padding: 18px;
  }

  .hero-info h2 {
    font-size: 20px;
  }

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

  .btn {
    padding: 7px 16px;
    font-size: 13px;
  }

  .sec {
    margin: 28px 0;
  }

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

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

  .card-info {
    padding: 8px 10px 10px;
  }

  .card-title {
    font-size: 13px;
  }

  .card-score {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }

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

  .cat-item {
    padding: 10px 14px;
    font-size: 14px;
  }

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

  .rank-num {
    font-size: 24px;
    min-width: 34px;
  }

  .detail-head {
    flex-direction: column;
    gap: 18px;
    padding: 16px;
  }

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

  .detail-meta h1 {
    font-size: 22px;
    text-align: center;
  }

  .detail-meta p {
    font-size: 13px;
  }

  .detail-score {
    font-size: 16px;
    display: flex;
    justify-content: center;
    margin: 12px auto;
    width: fit-content;
  }

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

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

  .footer {
    margin-top: 32px;
    padding: 24px 0 18px;
  }
}