:root {
  --bg: #FFF9F0;
  --surface: #FFFFFF;
  --primary: #FF8C42;
  --accent: #00E5C0;
  --text: #2B2B2B;
  --muted: #7A6E66;
  --radius: 20px;
  --radius-sm: 12px;
  --border: 2px solid #2B2B2B;
  --shadow: 6px 6px 0 rgba(43, 43, 43, 0.12);
  --font-heading: 'Poppins', 'Noto Sans SC', sans-serif;
  --font-body: 'Inter', 'Noto Sans SC', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color .2s ease;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.25;
}

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 249, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: var(--border);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--accent);
  border: var(--border);
  border-radius: 4px;
  transform: rotate(12deg);
  box-shadow: 2px 2px 0 var(--primary);
}

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

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

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

.nav a {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: all .2s ease;
}

.nav a:hover,
.nav a.active {
  background: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
  flex-shrink: 0;
}

.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;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  transition: transform .2s ease, background .2s ease;
}

.search-box button:hover {
  background: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
  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;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(43,43,43,.85) 0%, rgba(43,43,43,.45) 55%, rgba(43,43,43,.1) 100%);
}

.hero-info {
  position: relative;
  z-index: 2;
  padding: 36px;
  max-width: 620px;
  color: #fff;
}

.hero-info h1,
.hero-info h2 {
  font-size: 34px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.hero-info p {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  margin-bottom: 20px;
  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;
  border: var(--border);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 3px 3px 0 rgba(43,43,43,.4);
}

.btn:hover {
  background: var(--accent);
  color: var(--text);
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 5px 6px 0 rgba(43,43,43,.45);
}

.btn.ghost {
  background: transparent;
  color: #fff;
  border-color: #fff;
}

.btn.ghost:hover {
  background: #fff;
  color: var(--text);
}

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

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

.sec-title {
  position: relative;
  font-size: 22px;
  font-weight: 800;
  padding-left: 16px;
}

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

.sec-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

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

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

.card {
  position: relative;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  box-shadow: 4px 4px 0 rgba(43,43,43,.1);
}

.card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: 8px 10px 0 rgba(0,229,192,.35);
}

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

.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-weight: 800;
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 2px solid var(--text);
  z-index: 2;
}

.card-info {
  padding: 12px 14px 16px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.card-meta span {
  white-space: nowrap;
}

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

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  transition: all .2s ease;
}

.cat-item:hover {
  background: var(--accent);
  transform: translateY(-3px) rotate(1deg);
  box-shadow: 4px 5px 0 rgba(43,43,43,.25);
}

.cat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 10px;
}

.cat-item:hover .cat-count {
  background: var(--surface);
  color: var(--text);
}

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

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

.rank-item:hover {
  transform: translateX(4px);
  box-shadow: 4px 4px 0 rgba(255,140,66,.35);
}

.rank-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  background: var(--accent);
  border: 2px solid var(--text);
  border-radius: 10px;
  transform: rotate(-4deg);
}

.rank-item:nth-child(-n+3) .rank-num {
  background: var(--primary);
  color: #fff;
}

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

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

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

.detail-head {
  display: flex;
  gap: 32px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.detail-cover {
  flex-shrink: 0;
  width: 240px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: var(--border);
}

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

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

.detail-meta h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  background: var(--accent);
  border: 2px solid var(--text);
  border-radius: 999px;
  padding: 4px 16px;
  margin-bottom: 16px;
}

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

.detail-meta p strong {
  color: var(--text);
  font-weight: 600;
  margin-right: 4px;
}

.detail-body {
  margin-top: 24px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 28px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}

.detail-body h2 {
  font-size: 20px;
  margin: 24px 0 12px;
}

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

.detail-body p {
  margin-bottom: 12px;
}

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

.tag {
  display: inline-block;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--text);
  border-radius: 999px;
  transition: all .2s ease;
}

.tag:hover {
  background: var(--accent);
  transform: translateY(-2px) rotate(-2deg);
  color: var(--text);
}

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

.pg {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-sm);
  transition: all .2s ease;
}

.pg:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.pg.current {
  background: var(--primary);
  color: #fff;
  box-shadow: 3px 3px 0 rgba(43,43,43,.3);
}

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

/* ===== Links ===== */
.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;
  border: 1px dashed rgba(43,43,43,.25);
  transition: all .2s ease;
}

.link-item:hover {
  color: var(--text);
  background: var(--accent);
  border-color: var(--text);
  border-style: solid;
}

/* ===== Footer ===== */
.footer {
  margin-top: 60px;
  padding: 36px 0 28px;
  background: var(--text);
  color: rgba(255,255,255,.7);
  font-size: 13px;
  border-top: 4px solid var(--accent);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer a {
  color: rgba(255,255,255,.85);
}

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

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

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

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

.crumbs span {
  margin: 0 6px;
  opacity: .6;
}

/* ===== Highlight ===== */
.hl {
  background: var(--accent);
  color: var(--text);
  font-weight: 700;
  padding: 0 3px;
  border-radius: 4px;
}

/* ===== Responsive ===== */
@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: 2px;
    -webkit-overflow-scrolling: touch;
  }

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

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

  .search-box input {
    width: 100px;
  }

  .hero-slide {
    min-height: 260px;
  }

  .hero-info {
    padding: 22px;
  }

  .hero-info h1,
  .hero-info h2 {
    font-size: 24px;
  }

  .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(2, 1fr);
    gap: 10px;
  }

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

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

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

  .detail-cover {
    width: 160px;
    margin: 0 auto;
  }

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

  .detail-score {
    display: flex;
    justify-content: center;
    width: fit-content;
    margin: 0 auto 16px;
  }

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

  .footer .wrap {
    flex-direction: column;
    text-align: center;
  }
}