:root {
  --bg: #2B2927;
  --surface: #3A3733;
  --primary: #FF9E4A;
  --accent: #F4A261;
  --text: #F5EFE6;
  --muted: #B8AFA2;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow-dark: #201f1d;
  --shadow-light: #45403a;
  --font-heading: 'Courier New', monospace;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #302d2a 0%, #2B2927 100%);
  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 .2s ease;
}

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

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

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(43, 41, 39, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 158, 74, 0.18);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 2px 6px rgba(255, 158, 74, 0.25);
}

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

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

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

.nav a {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all .2s ease;
}

.nav a:hover {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-box input {
  width: 170px;
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light);
  transition: box-shadow .2s ease;
}

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

.search-box input:focus {
  box-shadow: inset 2px 2px 6px var(--shadow-dark), inset -2px -2px 6px var(--shadow-light), 0 0 0 2px rgba(255, 158, 74, 0.4);
}

.search-box button {
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #2B2927;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  transition: transform .15s ease, box-shadow .15s ease;
}

.search-box button:hover {
  transform: translateY(-1px);
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
}

.search-box button:active {
  transform: translateY(1px);
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3);
}

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

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

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

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

.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 32px 24px;
  background: linear-gradient(0deg, rgba(43,41,39,0.96) 10%, rgba(43,41,39,0.6) 60%, transparent 100%);
}

.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--text);
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

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

.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--primary), var(--accent));
  color: #2B2927;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}

.btn:hover {
  color: #2B2927;
  transform: translateY(-2px);
  box-shadow: 5px 5px 12px var(--shadow-dark), -5px -5px 12px var(--shadow-light);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: inset 2px 2px 5px rgba(0,0,0,0.3);
}

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

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

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

.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  box-shadow: 0 0 8px rgba(255, 158, 74, 0.5);
}

.sec-more {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  transition: all .2s ease;
}

.sec-more:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

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

.card {
  position: relative;
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 6px 6px 16px var(--shadow-dark), -6px -6px 16px var(--shadow-light);
  transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 8px 8px 22px var(--shadow-dark), -8px -8px 22px var(--shadow-light);
}

.card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #2f2c29;
}

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

.card:hover .card-cover img {
  transform: scale(1.06);
}

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  min-width: 38px;
  padding: 3px 8px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: #2B2927;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  box-shadow: 2px 2px 6px rgba(0,0,0,0.45), -1px -1px 3px rgba(255,255,255,0.15);
}

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  font-family: var(--font-heading);
  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: 6px;
  padding: 18px 10px;
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text);
  box-shadow: 5px 5px 14px var(--shadow-dark), -5px -5px 14px var(--shadow-light);
  transition: transform .2s ease, color .2s ease;
}

.cat-item:hover {
  transform: translateY(-3px);
  color: var(--primary);
}

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

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

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

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

.rank-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: #2B2927;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  box-shadow: 2px 2px 6px rgba(0,0,0,0.4);
}

.rank-item:nth-child(n+4) .rank-num {
  background: var(--surface);
  color: var(--muted);
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

.rank-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

.detail-head {
  display: flex;
  gap: 28px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 8px 8px 22px var(--shadow-dark), -8px -8px 22px var(--shadow-light);
}

.detail-cover {
  flex-shrink: 0;
  width: 240px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #2f2c29;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.4);
}

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

.detail-meta {
  flex: 1;
  min-width: 0;
}

.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

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

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

.detail-score {
  display: inline-block;
  margin: 10px 0;
  padding: 6px 16px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: #2B2927;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  box-shadow: 3px 3px 8px rgba(0,0,0,0.4);
}

.detail-body {
  margin-top: 24px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 6px 6px 18px var(--shadow-dark), -6px -6px 18px var(--shadow-light);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}

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

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

.detail-body p {
  margin-bottom: 12px;
  color: var(--muted);
}

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

.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
  transition: color .2s ease;
}

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

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

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light);
  transition: all .2s ease;
}

.pg:hover {
  color: var(--primary);
  transform: translateY(-2px);
}

.pg.current {
  color: #2B2927;
  font-weight: 700;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  box-shadow: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
}

.pg.disabled {
  color: var(--muted);
  opacity: 0.5;
  pointer-events: none;
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

/* ===== 友情链接 ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 3px 3px 8px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light);
}

.link-item {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  transition: color .2s ease;
}

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

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

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

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

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

/* ===== 搜索高亮 ===== */
.hl {
  color: var(--primary);
  font-weight: 700;
  background: rgba(255, 158, 74, 0.12);
  border-radius: 4px;
  padding: 0 2px;
}

/* ===== 页脚 ===== */
.footer {
  margin-top: 56px;
  padding: 32px 0 40px;
  border-top: 1px solid rgba(255, 158, 74, 0.15);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.2));
  text-align: center;
  font-family: var(--font-heading);
  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);
  }
}

@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: 19px;
  }

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

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

  .search-box {
    margin-left: auto;
  }

  .search-box input {
    width: 130px;
    height: 34px;
  }

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

  .hero {
    margin: 16px auto;
    border-radius: var(--radius-sm);
  }

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

  .hero-info {
    padding: 40px 18px 18px;
  }

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

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

  .sec {
    margin: 28px 0;
  }

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

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

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

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

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

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

  .detail-cover {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }

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

  .detail-meta p {
    text-align: center;
  }

  .detail-score {
    display: block;
    width: fit-content;
    margin: 12px auto;
  }

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

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

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