:root {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --primary: #7B6CF6;
  --accent: #F5A3C7;
  --text: #2C3A4B;
  --muted: #8A9BB0;
  --radius: 16px;
  --font-heading: 'Playfair Display', 'Times New Roman', 'Noto Serif SC', serif;
  --font-body: 'Inter', 'Noto Sans SC', 'Helvetica Neue', sans-serif;
  --shadow-sm: 0 2px 8px rgba(44, 58, 75, 0.06);
  --shadow-md: 0 8px 24px rgba(123, 108, 246, 0.12);
  --gradient: linear-gradient(135deg, #7B6CF6 0%, #F5A3C7 100%);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; transition: color .2s ease, opacity .2s ease; }
a:hover { color: var(--primary); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button, input { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.25; }

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(123, 108, 246, 0.1);
}

.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: .5px;
  white-space: nowrap;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
}

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

.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: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  transition: all .2s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(123, 108, 246, 0.1);
  color: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid rgba(123, 108, 246, 0.15);
  border-radius: 999px;
  padding: 0 4px 0 16px;
  height: 40px;
  min-width: 220px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(123, 108, 246, 0.12);
}

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

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

.search-box button {
  border: none;
  cursor: pointer;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: opacity .2s ease;
}

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

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

.hero-slide {
  position: relative;
  display: block;
  aspect-ratio: 21 / 8;
  min-height: 260px;
  background: var(--bg);
  overflow: hidden;
}

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(44, 58, 75, 0.85) 0%, rgba(44, 58, 75, 0.15) 55%, transparent 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: 30px;
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(123, 108, 246, 0.3);
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(123, 108, 246, 0.4);
}

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

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

.sec-title {
  font-size: 24px;
  position: relative;
  padding-left: 16px;
}

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

.sec-more {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.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: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}

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

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

.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: 10px;
  right: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
  box-shadow: 0 2px 8px rgba(123, 108, 246, .35);
}

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

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

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 分类 ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 22px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
  border: 1px solid transparent;
}

.cat-item:hover {
  transform: translateY(-4px);
  border-color: rgba(123, 108, 246, .3);
  box-shadow: var(--shadow-md);
  color: var(--primary);
}

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

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

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

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

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

.rank-num {
  flex: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--gradient);
}

.rank-item:nth-child(n+4) .rank-num {
  background: var(--bg);
  color: var(--muted);
}

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

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

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

.detail-head {
  display: flex;
  gap: 32px;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.detail-cover {
  flex: none;
  width: 220px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

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

.detail-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
}

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

.detail-meta p strong { color: var(--text); font-weight: 600; }

.detail-body {
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  line-height: 1.9;
  font-size: 15px;
}

.detail-body h2,
.detail-body h3 {
  font-size: 20px;
  margin: 20px 0 12px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
}

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

.detail-body img { border-radius: 12px; margin: 12px 0; }

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

.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--primary);
  background: rgba(123, 108, 246, 0.1);
  transition: all .2s ease;
}

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

/* ===== 分页 ===== */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  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;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}

.pg:hover {
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

.pg.current {
  background: var(--gradient);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(123, 108, 246, .3);
}

.pg.disabled {
  opacity: .45;
  pointer-events: none;
  cursor: default;
}

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

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

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

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

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

/* ===== 搜索高亮 ===== */
.hl {
  color: var(--primary);
  background: rgba(245, 163, 199, 0.28);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 56px;
  padding: 36px 0 28px;
  background: var(--surface);
  border-top: 1px solid rgba(123, 108, 246, 0.1);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}

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

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

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

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

  .logo { font-size: 19px; }

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

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

  .search-box {
    min-width: 0;
    flex: 1;
    height: 36px;
  }

  .search-box button { padding: 0 12px; }

  .hero { margin: 18px 0; }
  .hero-slide { aspect-ratio: 16 / 9; min-height: 200px; }
  .hero-info { padding: 18px; }
  .hero-info h2 { font-size: 19px; }
  .hero-info p { font-size: 12px; -webkit-line-clamp: 2; margin-bottom: 12px; }
  .btn { padding: 8px 18px; font-size: 13px; }

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

  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-info { padding: 10px 10px 12px; }
  .card-title { font-size: 13px; }

  .cat-list { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .cat-item { padding: 16px 8px; }
  .cat-item span:first-child,
  .cat-item .cat-name { font-size: 14px; }

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

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

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

  .detail-meta h1 { font-size: 21px; }
  .detail-body { padding: 18px; font-size: 14px; }

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

  .footer { margin-top: 36px; padding: 24px 0 20px; }
}