:root {
  --bg: #FFF6EA;
  --surface: #FFEEDC;
  --primary: #F08A3C;
  --accent: #E8A87C;
  --text: #5A3E2B;
  --muted: #A68B76;
  --radius: 28px;
  --radius-sm: 16px;
  --shadow: 6px 6px 16px rgba(200, 160, 120, .28), -6px -6px 16px rgba(255, 255, 255, .85);
  --shadow-sm: 3px 3px 10px rgba(200, 160, 120, .22), -3px -3px 10px rgba(255, 255, 255, .8);
  --font-heading: 'Caveat', 'Comic Sans MS', cursive, 'PingFang SC', sans-serif;
  --font-body: 'Nunito', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { 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;
  background-image: radial-gradient(circle at 12% 8%, rgba(232, 168, 124, .14) 0, transparent 26%),
                    radial-gradient(circle at 88% 92%, rgba(240, 138, 60, .1) 0, transparent 30%);
  background-attachment: fixed;
}

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

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 12px;
  z-index: 100;
  margin: 12px auto 0;
  max-width: 1200px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 246, 234, .86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.logo {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logo::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), var(--accent), var(--surface), var(--primary));
  box-shadow: inset 0 0 0 4px var(--bg);
  flex: none;
}

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

.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  transition: all .25s ease;
  font-size: 14px;
}
.nav a:hover {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  box-shadow: inset 2px 2px 6px rgba(200, 160, 120, .2), inset -2px -2px 6px rgba(255, 255, 255, .7);
  flex: none;
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  width: 130px;
  padding: 6px 0;
  font-size: 14px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 13px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.search-box button:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(240, 138, 60, .4); }

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

.hero-slide {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(90, 62, 43, 0) 30%, rgba(90, 62, 43, .82) 100%);
}

.hero-info {
  position: relative;
  z-index: 2;
  padding: 34px 36px;
  color: #FFF6EA;
  max-width: 640px;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}
.hero-info p {
  color: rgba(255, 246, 234, .86);
  font-size: 14px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(240, 138, 60, .38);
  transition: transform .22s ease, box-shadow .22s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(240, 138, 60, .48); }
.btn.ghost {
  background: rgba(255, 246, 234, .18);
  color: #FFF6EA;
  box-shadow: none;
  border: 1px solid rgba(255, 246, 234, .5);
}

/* ===== 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: 30px;
  color: var(--text);
  position: relative;
  padding-left: 18px;
  line-height: 1.2;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.sec-more {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease;
  white-space: nowrap;
}
.sec-more:hover { transform: translateX(3px); }

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

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
  transition: transform .28s ease, box-shadow .28s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 10px 12px 28px rgba(200, 160, 120, .34), -8px -8px 22px rgba(255, 255, 255, .9);
}

.card-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  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: 8px;
  right: 8px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 2px 12px;
  border-radius: 999px 999px 999px 6px;
  box-shadow: 0 4px 10px rgba(240, 138, 60, .45);
  line-height: 1.3;
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 40px;
}

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

/* ===== Categories ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 700;
  color: var(--text);
  transition: transform .25s ease, color .25s ease;
}
.cat-item:hover { transform: translateY(-4px); color: var(--primary); }

.cat-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 999px;
  box-shadow: inset 1px 1px 3px rgba(200, 160, 120, .25);
}

/* ===== Rank ===== */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.rank-item:hover { transform: translateX(5px); box-shadow: var(--shadow); }

.rank-num {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  width: 40px;
  text-align: center;
  flex: none;
}
.rank-item:nth-child(1) .rank-num,
.rank-item:nth-child(2) .rank-num,
.rank-item:nth-child(3) .rank-num { color: var(--primary); }

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

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

/* ===== Detail ===== */
.detail { margin: 30px 0; }

.detail-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.detail-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }

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

.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 40px;
  line-height: 1.15;
  color: var(--text);
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

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

.detail-body {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 30px;
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  margin-bottom: 12px;
  color: var(--primary);
}
.detail-body p { margin-bottom: 12px; }

/* ===== Tags ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.tag:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }

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

.pg {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all .2s ease;
}
.pg:hover { color: var(--primary); transform: translateY(-2px); }
.pg.current {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 6px 16px rgba(240, 138, 60, .4);
}
.pg.disabled {
  opacity: .45;
  pointer-events: none;
  box-shadow: none;
}

/* ===== Links ===== */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
}
.link-item:hover { color: var(--primary); background: var(--bg); }

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

/* ===== Highlight ===== */
.hl {
  color: var(--primary);
  background: rgba(240, 138, 60, .16);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 700;
}

/* ===== Footer ===== */
.footer {
  margin-top: 60px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px dashed rgba(166, 139, 118, .35);
  background: linear-gradient(180deg, transparent, rgba(255, 238, 220, .6));
}
.footer a { color: var(--primary); }
.footer p { margin: 4px 0; }

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

  .header {
    top: 8px;
    margin: 8px 10px 0;
    padding: 8px 12px;
    gap: 10px;
    border-radius: 22px;
    flex-wrap: wrap;
  }
  .logo { font-size: 24px; }
  .logo::before { width: 18px; height: 18px; }

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

  .search-box { margin-left: auto; }
  .search-box input { width: 90px; }

  .hero { margin: 18px 0; border-radius: 22px; }
  .hero-slide { min-height: 300px; }
  .hero-info { padding: 22px 20px; }
  .hero-info h2 { font-size: 30px; }

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

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card { padding: 9px; border-radius: 20px; }
  .card-title { font-size: 14px; min-height: 38px; }
  .card-score { font-size: 17px; padding: 1px 10px; }

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

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

  .rank-item { padding: 10px 14px; gap: 10px; border-radius: 20px; }
  .rank-num { font-size: 22px; width: 30px; }
  .rank-title { font-size: 14px; }
  .rank-score { font-size: 18px; }

  .pg { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
  .links { padding: 16px; border-radius: 22px; }
  .footer { margin-top: 40px; padding: 24px 14px; }
}

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