:root {
  --bg: #EDF1F5;
  --surface: #FFFFFF;
  --primary: #2E5A88;
  --accent: #FF6B5A;
  --text: #1F2A33;
  --muted: #7A8D9C;
  --radius: 16px;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.75);
  --font: 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
}

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

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

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

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

.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(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}

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

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: "";
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 3px;
  transform: rotate(20deg);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.nav a:hover {
  background: rgba(46, 90, 136, 0.1);
  color: var(--primary);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid rgba(46, 90, 136, 0.15);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  flex-shrink: 0;
}

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

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

.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

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

/* ===== Hero 轮播 ===== */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: var(--primary);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  animation: heroFade 18s infinite;
}

.hero-slide:nth-child(2) { animation-delay: 6s; }
.hero-slide:nth-child(3) { animation-delay: 12s; }

@keyframes heroFade {
  0%, 30% { opacity: 1; }
  36%, 94% { opacity: 0; }
  100% { opacity: 1; }
}

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

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

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

.hero-info h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 10px;
}

.hero-info p {
  font-size: 14px;
  opacity: 0.85;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.2s, background 0.2s;
}

.btn:hover { transform: scale(1.05); background: #ff5544; }

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

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

.sec-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}

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

.sec-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(46, 90, 136, 0.25);
  transition: background 0.2s, color 0.2s;
}

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

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(46, 90, 136, 0.08);
  transition: transform 0.25s ease;
}

.card:hover { transform: scale(1.03); }

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

.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;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
}

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== 分类 ===== */
.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;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  transition: transform 0.2s, background 0.2s;
}

.cat-item:hover { transform: translateY(-3px) rotate(-1deg); background: var(--surface); }

.cat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(46, 90, 136, 0.08);
  padding: 2px 10px;
  border-radius: 999px;
}

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

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid rgba(46, 90, 136, 0.08);
  border-radius: var(--radius);
  padding: 12px 16px;
  transition: transform 0.2s;
}

.rank-item:hover { transform: translateX(4px); }

.rank-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  transform: rotate(-4deg);
}

.rank-item:nth-child(1) .rank-num { background: var(--accent); }
.rank-item:nth-child(2) .rank-num { background: #F5A623; }
.rank-item:nth-child(3) .rank-num { background: #4CAF88; }

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

.rank-score {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}

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

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

.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #dde4ec;
}

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

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

.detail-meta h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 4px 14px;
  border-radius: 999px;
  width: fit-content;
}

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

.detail-body {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid rgba(46, 90, 136, 0.08);
  padding: 28px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.detail-body h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 20px 0 10px;
  color: var(--primary);
}

.detail-body h2:first-child { margin-top: 0; }

.detail-body p { margin-bottom: 12px; color: #3a4753; }

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

.tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(46, 90, 136, 0.08);
  border: 1px solid rgba(46, 90, 136, 0.15);
  padding: 4px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

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

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

.pg {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 1.5px solid rgba(46, 90, 136, 0.15);
  border-radius: 12px;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.pg:hover { background: rgba(46, 90, 136, 0.08); transform: translateY(-2px); }

.pg.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

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

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: color 0.2s;
}

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

/* ===== 页脚 ===== */
.footer {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid rgba(46, 90, 136, 0.1);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}

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

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

.crumbs a { color: var(--primary); font-weight: 600; }
.crumbs a:hover { color: var(--accent); }

/* ===== 搜索高亮 ===== */
.hl {
  color: var(--accent);
  font-weight: 800;
  background: rgba(255, 107, 90, 0.1);
  border-radius: 4px;
  padding: 0 2px;
}

/* ===== 移动端 ===== */
@media (max-width: 768px) {
  .wrap { padding: 0 14px; }

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

  .logo { font-size: 18px; }

  .search-box { order: 3; width: 100%; }
  .search-box input { width: 100%; flex: 1; }

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

  .hero { aspect-ratio: 4 / 5; margin: 18px 0; }

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

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

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

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

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

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

  .detail-cover { max-width: 180px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; text-align: center; }
  .detail-score { margin: 0 auto; }
  .detail-meta p { text-align: center; }

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

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