:root {
  --bg: #FFF7EC;
  --surface: #FFFDF9;
  --primary: #F47B2A;
  --accent: #FFC94D;
  --text: #3B2E24;
  --muted: #A08D7C;
  --radius: 28px;
  --radius-sm: 16px;
  --shadow: 0 12px 32px rgba(244, 123, 42, 0.12), 0 4px 12px rgba(59, 46, 36, 0.06);
  --shadow-hover: 0 20px 44px rgba(244, 123, 42, 0.2), 0 8px 18px rgba(59, 46, 36, 0.1);
  --font-heading: '隔空手写', 'Klee One', 'Ma Shan Zheng', 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', 'Hiragino Sans GB', 'PingFang SC', sans-serif;
}

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

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

body {
  background: var(--bg);
  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 .2s ease; }
a:hover { color: var(--primary); }
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 {
  background: var(--surface);
  border-bottom: 2px solid rgba(244, 123, 42, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 18px rgba(244, 123, 42, 0.06);
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 68px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.logo::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--primary);
}

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

.nav a {
  display: inline-block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: 999px;
  white-space: nowrap;
  transition: all .2s ease;
}
.nav a:hover {
  background: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 2px solid rgba(244, 123, 42, 0.25);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  flex-shrink: 0;
  transition: border-color .2s ease;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  width: 150px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: none;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease;
}
.search-box button:hover { background: #e06a1c; }

/* ===== Hero 轮播 ===== */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  aspect-ratio: 21 / 9;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
}
.hero-slide:first-child,
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 40px 32px;
  background: linear-gradient(to top, rgba(59, 46, 36, 0.85), transparent);
  color: #fff;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.hero-info p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 620px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Button ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  border: 2px solid var(--primary);
  cursor: pointer;
  transition: all .2s ease;
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 201, 77, 0.4);
}

/* ===== Section ===== */
.sec { margin: 40px 0; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  position: relative;
  padding-left: 18px;
}
.sec-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 24px;
  border-radius: 4px;
  background: var(--primary);
}
.sec-more {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px dashed rgba(244, 123, 42, 0.4);
  transition: all .2s ease;
}
.sec-more:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(244, 123, 42, 0.06);
}

/* ===== Grid / Card ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}
.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.06); }
.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.card-info {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Cat List ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 2px solid rgba(244, 123, 42, 0.15);
  font-weight: 600;
  font-size: 15px;
  transition: all .2s ease;
}
.cat-item:hover {
  border-color: var(--primary);
  background: rgba(255, 201, 77, 0.15);
  transform: translateY(-3px);
  color: var(--primary);
}
.cat-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 999px;
}

/* ===== Rank List ===== */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: all .2s ease;
}
.rank-item:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-hover);
}
.rank-num {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  font-style: italic;
  color: var(--primary);
  line-height: 1;
  min-width: 56px;
  text-align: center;
  opacity: .85;
}
.rank-item:nth-child(1) .rank-num { color: #E63946; }
.rank-item:nth-child(2) .rank-num { color: #F47B2A; }
.rank-item:nth-child(3) .rank-num { color: #FFC94D; }
.rank-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* ===== Detail ===== */
.detail {
  margin: 28px 0;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.detail-head {
  display: flex;
  gap: 32px;
  margin-bottom: 28px;
}
.detail-cover {
  width: 260px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  line-height: 1.3;
  color: var(--text);
}
.detail-meta p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.9;
}
.detail-meta p strong { color: var(--text); font-weight: 600; }
.detail-score {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}
.detail-body {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  border-top: 2px dashed rgba(244, 123, 42, 0.2);
  padding-top: 24px;
}
.detail-body p { margin-bottom: 14px; }

/* ===== Tag List ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.tag {
  display: inline-block;
  padding: 5px 16px;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 201, 77, 0.25);
  border: 1.5px solid rgba(244, 123, 42, 0.3);
  border-radius: 999px;
  transition: all .2s ease;
}
.tag:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Pager ===== */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 36px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 2px solid rgba(244, 123, 42, 0.2);
  border-radius: 12px;
  transition: all .2s ease;
}
.pg:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.pg.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}
.pg.disabled {
  opacity: .4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 20px 0;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  transition: color .2s ease;
}
.link-item:hover { color: var(--primary); }

/* ===== Footer ===== */
.footer {
  margin-top: 48px;
  padding: 36px 0 28px;
  background: var(--surface);
  border-top: 2px solid rgba(244, 123, 42, 0.12);
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }

/* ===== Crumbs ===== */
.crumbs {
  font-size: 13px;
  color: var(--muted);
  padding: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--text); font-weight: 500; }

/* ===== Highlight ===== */
.hl {
  color: var(--primary);
  font-weight: 700;
  background: rgba(255, 201, 77, 0.35);
  padding: 0 3px;
  border-radius: 4px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .cat-list { grid-template-columns: repeat(3, 1fr); }
  .detail-cover { width: 200px; }
  .detail-meta h1 { font-size: 26px; }
}

@media (max-width: 768px) {
  .wrap { padding: 0 14px; }
  .header .wrap {
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo { font-size: 22px; }
  .nav {
    order: 3;
    width: 100%;
    flex: none;
    gap: 4px;
    padding-bottom: 2px;
  }
  .nav a { padding: 6px 12px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 100px; }

  .hero {
    aspect-ratio: 4 / 3;
    margin: 18px 0;
    border-radius: 20px;
  }
  .hero-info { padding: 40px 20px 20px; }
  .hero-info h2 { font-size: 22px; }
  .hero-info p { font-size: 13px; }

  .sec { margin: 28px 0; }
  .sec-title { font-size: 20px; }
  .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-num { font-size: 30px; min-width: 42px; }
  .rank-title { font-size: 14px; }
  .rank-score { font-size: 16px; }

  .detail { padding: 20px; border-radius: 20px; }
  .detail-head { flex-direction: column; gap: 20px; }
  .detail-cover { width: 100%; max-width: 220px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; text-align: center; }
  .detail-score { font-size: 34px; text-align: center; }

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