:root {
  --bg: #0E0C0A;
  --surface: #1C1814;
  --primary: #FFB347;
  --accent: #A78BFA;
  --text: #F5F0E8;
  --muted: #9A8B7A;
  --radius: 28px;
  --radius-sm: 16px;
  --glow: 0 0 24px rgba(255, 179, 71, .28);
  --glow-strong: 0 0 32px rgba(255, 179, 71, .45);
  --cyan: #5EEAD4;
  --font-heading: "Yozai", "Ma Shan Zheng", cursive, "Noto Serif SC", serif;
  --font-body: "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 179, 71, .07), transparent 42%),
    radial-gradient(circle at 88% 92%, rgba(167, 139, 250, .08), transparent 46%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--primary); }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; margin: 0; letter-spacing: .5px; }
ul, ol { list-style: none; margin: 0; padding: 0; }

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

/* ============ Header ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 12, 10, .72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(255, 179, 71, .12);
}
.header .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 68px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  color: var(--primary);
  text-shadow: var(--glow);
  white-space: nowrap;
  flex-shrink: 0;
}
.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 {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.nav a:hover,
.nav a.active {
  color: var(--primary);
  background: rgba(255, 179, 71, .1);
  box-shadow: inset 0 0 0 1px rgba(255, 179, 71, .28);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid rgba(255, 179, 71, .16);
  border-radius: 999px;
  padding: 5px 6px 5px 16px;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: var(--glow);
}
.search-box input {
  width: 150px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: 0;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #FF9A2E);
  color: #1C1814;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: box-shadow .25s ease, transform .2s ease;
}
.search-box button:hover { box-shadow: var(--glow-strong); transform: translateY(-1px); }

/* ============ Hero 轮播 ============ */
.hero {
  position: relative;
  margin: 26px auto 0;
  max-width: 1200px;
  padding: 0 20px;
}
.hero-slide {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), var(--glow);
  aspect-ratio: 21 / 9;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}
.hero-slide:hover img { transform: scale(1.04); }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 12, 10, .92) 0%, rgba(14, 12, 10, .55) 42%, transparent 78%),
              linear-gradient(0deg, rgba(14, 12, 10, .85), transparent 55%);
}
.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 34px 40px;
  max-width: 560px;
}
.hero-info h2 {
  font-size: 34px;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--text);
  text-shadow: 0 4px 24px rgba(0, 0, 0, .8);
}
.hero-info p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-info .hero-meta { color: var(--primary); font-size: 13px; margin-bottom: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, .5);
  background: rgba(255, 179, 71, .12);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all .25s ease;
}
.btn:hover {
  background: linear-gradient(135deg, var(--primary), #FF9A2E);
  color: #1C1814;
  box-shadow: var(--glow-strong);
  transform: translateY(-2px);
}

/* ============ Section ============ */
.sec { margin: 46px auto; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
  padding-left: 14px;
}
.sec-title {
  font-size: 24px;
  color: var(--text);
  position: relative;
}
.sec-title::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  vertical-align: middle;
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.sec-more:hover { color: var(--primary); }

/* ============ 卡片网格 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  border: 1px solid rgba(255, 179, 71, .08);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(94, 234, 212, .6);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(94, 234, 212, .35), var(--glow);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #14110E;
}
.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: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(14, 12, 10, .78);
  backdrop-filter: blur(6px);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 179, 71, .4);
}
.card-info { padding: 12px 12px 14px; }
.card-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 分类 ============ */
.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: 20px 10px;
  border-radius: var(--radius-sm);
  background: rgba(28, 24, 20, .7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(167, 139, 250, .16);
  text-align: center;
  transition: all .25s ease;
}
.cat-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(167, 139, 250, .3);
  transform: translateY(-3px);
  color: var(--primary);
}
.cat-item span:first-child { font-size: 15px; font-weight: 600; }
.cat-count {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--muted);
}

/* ============ 排行榜 ============ */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 30px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-bottom: 1px dashed rgba(154, 139, 122, .16);
  transition: background .25s ease;
}
.rank-item:hover { background: rgba(255, 179, 71, .06); }
.rank-num {
  flex-shrink: 0;
  width: 42px;
  font-family: var(--font-heading);
  font-size: 30px;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 179, 71, .55);
  text-align: center;
}
.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num {
  color: var(--primary);
  -webkit-text-stroke: 0;
  text-shadow: var(--glow);
}
.rank-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-score {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

/* ============ 详情页 ============ */
.detail { margin: 34px auto; }
.detail-head {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 36px;
  padding: 30px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(28, 24, 20, .92), rgba(20, 17, 14, .92));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 179, 71, .12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.detail-cover {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6), var(--glow);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}
.detail-meta h1 {
  font-size: 32px;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 4px;
}
.detail-meta p { margin: 0; }
.detail-meta strong { color: var(--text); font-weight: 500; }
.detail-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 40px;
  color: var(--primary);
  text-shadow: var(--glow);
  line-height: 1;
}
.detail-score small { font-size: 14px; color: var(--muted); font-family: var(--font-body); }
.detail-body {
  margin-top: 26px;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(255, 179, 71, .08);
  line-height: 1.9;
  color: #D9D2C6;
}
.detail-body h2, .detail-body h3 {
  color: var(--primary);
  margin: 18px 0 10px;
  font-size: 20px;
}
.detail-body p { margin: 0 0 14px; }
.detail-body a { color: var(--accent); }

/* ============ 标签 ============ */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 179, 71, .07);
  border: 1px solid rgba(255, 179, 71, .18);
  transition: all .25s ease;
}
.tag:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--glow);
}

/* ============ 分页 ============ */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px 0 10px;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 14px;
  font-size: 14px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid rgba(255, 179, 71, .12);
  transition: all .25s ease;
}
.pg:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--glow);
}
.pg.current {
  color: #1C1814;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), #FF9A2E);
  border-color: transparent;
  box-shadow: var(--glow-strong);
}
.pg.disabled {
  opacity: .35;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============ 友链 ============ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 22px;
  border-radius: var(--radius-sm);
  background: rgba(28, 24, 20, .6);
  border: 1px dashed rgba(154, 139, 122, .22);
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  transition: all .25s ease;
}
.link-item:hover {
  color: var(--accent);
  background: rgba(167, 139, 250, .1);
  box-shadow: 0 0 14px rgba(167, 139, 250, .25);
}

/* ============ 面包屑 ============ */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 20px 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--primary); }

/* ============ 搜索高亮 ============ */
.hl {
  color: #1C1814;
  background: linear-gradient(135deg, var(--primary), #FFD98A);
  padding: 0 4px;
  border-radius: 5px;
  font-weight: 700;
}

/* ============ Footer ============ */
.footer {
  margin-top: 60px;
  padding: 40px 0 34px;
  border-top: 1px solid rgba(255, 179, 71, .1);
  background: linear-gradient(180deg, transparent, rgba(28, 24, 20, .6));
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }
.footer .footer-brand {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--primary);
  text-shadow: var(--glow);
  margin-bottom: 8px;
}

/* ============ 滚动渐显 ============ */
.card, .rank-item, .cat-item, .hero-slide {
  animation: fadeUp .6s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 响应式 ============ */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(4, 1fr); }
  .detail-head { grid-template-columns: 240px 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  .wrap { padding: 0 14px; }
  .header .wrap {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .logo { font-size: 20px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { padding: 6px 12px; font-size: 13px; }
  .search-box { flex: 1; padding-left: 12px; }
  .search-box input { width: 100%; min-width: 0; }

  .hero { padding: 0 14px; margin-top: 16px; }
  .hero-slide { aspect-ratio: 4 / 5; border-radius: 22px; }
  .hero-slide::after {
    background: linear-gradient(0deg, rgba(14, 12, 10, .95) 8%, rgba(14, 12, 10, .35) 60%, transparent);
  }
  .hero-info { padding: 20px 18px; max-width: 100%; }
  .hero-info h2 { font-size: 22px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }
  .btn { padding: 9px 22px; font-size: 13px; }

  .sec { margin: 30px auto; }
  .sec-title { font-size: 19px; }

  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card { border-radius: 14px; }
  .card-info { padding: 8px 8px 10px; }
  .card-title { font-size: 12px; }
  .card-meta { font-size: 11px; }
  .card-score { top: 6px; right: 6px; padding: 2px 7px; font-size: 11px; }

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

  .rank-list { grid-template-columns: 1fr; gap: 0; }
  .rank-item { padding: 10px 8px; gap: 12px; }
  .rank-num { width: 32px; font-size: 24px; }
  .rank-title { font-size: 13px; }

  .detail { margin: 20px auto; }
  .detail-head {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 18px;
    border-radius: 22px;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; text-align: center; }
  .detail-meta { text-align: center; align-items: center; }
  .detail-score { font-size: 32px; }
  .detail-body { padding: 18px; border-radius: 22px; font-size: 14px; }

  .links { padding: 14px; }
  .pg { min-width: 34px; height: 34px; padding: 0 10px; font-size: 13px; border-radius: 10px; }

  .footer { margin-top: 40px; padding: 28px 0 24px; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-list { grid-template-columns: repeat(2, 1fr); }
}