:root {
  --bg: #F6F1E7;
  --surface: #FBF7F0;
  --primary: #9A742E;
  --accent: #D6B36A;
  --text: #3E2F1C;
  --muted: #8A7A63;
  --radius: 16px;
  --shadow-light: -6px -6px 14px rgba(255, 255, 255, 0.85);
  --shadow-dark: 6px 6px 16px rgba(62, 47, 28, 0.12);
  --shadow-soft: 0 8px 24px rgba(62, 47, 28, 0.1);
  --font-heading: 'Georgia', 'Times New Roman', serif;
  --font-body: 'Helvetica Neue', Arial, sans-serif;
}

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

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

a { color: inherit; text-decoration: none; }
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);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo::before {
  content: "◉";
  color: var(--accent);
  margin-right: 6px;
  font-size: 18px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  transition: all 0.25s ease;
}
.nav a:hover {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-light), var(--shadow-dark);
}
.search-box {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  box-shadow: inset 3px 3px 8px rgba(62, 47, 28, 0.12),
              inset -3px -3px 8px rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text);
  width: 140px;
  font-family: var(--font-body);
}
.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-size: 13px;
  transition: background 0.25s;
}
.search-box button:hover { background: var(--accent); }

/* ===== Hero ===== */
.hero {
  position: relative;
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-light), var(--shadow-dark);
  background: var(--surface);
}
.hero-slide {
  position: relative;
  aspect-ratio: 16 / 7;
  overflow: hidden;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(62, 47, 28, 0.85) 0%, rgba(62, 47, 28, 0.35) 55%, transparent 100%);
}
.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 32px 40px;
  z-index: 2;
  max-width: 60%;
  color: #fff;
}
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 32px;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.hero-info p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.btn {
  display: inline-block;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(154, 116, 46, 0.4);
  transition: all 0.25s ease;
}
.btn:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(214, 179, 106, 0.5);
}

/* ===== Section ===== */
.sec { margin: 40px 0; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  position: relative;
}
.sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 12px, transparent 12px 20px);
  opacity: 0.5;
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 22px;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--primary));
}
.sec-more {
  font-size: 13px;
  color: var(--muted);
  transition: color 0.25s;
}
.sec-more:hover { color: var(--primary); }
.sec-more::after { content: " ›"; }

/* ===== Grid & Card ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 22px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: -8px -8px 18px rgba(255, 255, 255, 0.9),
              10px 12px 26px rgba(62, 47, 28, 0.18);
}
.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 0.4s ease;
}
.card:hover .card-cover img { transform: scale(1.05); }
.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(62, 47, 28, 0.78);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card-info { padding: 12px 14px 16px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.card-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Category list ===== */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  font-size: 14px;
  color: var(--text);
  transition: all 0.25s ease;
}
.cat-item:hover {
  color: var(--primary);
  transform: translateY(-2px);
}
.cat-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 1px 8px;
  border-radius: 999px;
}

/* ===== Rank list ===== */
.rank-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: transform 0.25s 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: 50%;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  background: var(--bg);
  box-shadow: inset 2px 2px 5px rgba(62, 47, 28, 0.12),
              inset -2px -2px 5px rgba(255, 255, 255, 0.9);
}
.rank-item:nth-child(1) .rank-num { color: #B8860B; }
.rank-item:nth-child(2) .rank-num { color: #8C8C8C; }
.rank-item:nth-child(3) .rank-num { color: #A0522D; }
.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: 14px;
  font-weight: 700;
  color: var(--primary);
}

/* ===== Detail ===== */
.detail {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin: 32px 0;
}
.detail-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-light), var(--shadow-dark);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0;
}
.detail-meta span { white-space: nowrap; }
.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}
.detail-score::before { content: "★"; font-size: 20px; color: var(--accent); }
.detail-body {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px 30px;
  box-shadow: var(--shadow-light), var(--shadow-dark);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
}
.detail-body h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  margin-bottom: 10px;
}
.detail-body p { margin-bottom: 14px; }

/* ===== Tags ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: all 0.25s ease;
}
.tag:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== Pager ===== */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 36px 0;
}
.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  transition: all 0.25s ease;
}
.pg:hover { color: var(--primary); transform: translateY(-2px); }
.pg.current {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(154, 116, 46, 0.4);
}
.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
}

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

/* ===== Footer ===== */
.footer {
  margin-top: 50px;
  padding: 30px 0;
  background: var(--surface);
  box-shadow: inset 0 4px 12px rgba(62, 47, 28, 0.05);
  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: 16px 0;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { margin: 0 6px; }

/* ===== Highlight ===== */
.hl {
  color: var(--primary);
  background: rgba(214, 179, 106, 0.25);
  border-radius: 3px;
  padding: 0 2px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .wrap { padding: 0 14px; }
  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 10px;
  }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .search-box { margin-left: auto; }
  .search-box input { width: 100px; }
  .hero-slide { aspect-ratio: 4 / 3; }
  .hero-info {
    max-width: 100%;
    padding: 20px;
  }
  .hero-info h2 { font-size: 22px; }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .rank-list { grid-template-columns: 1fr; }
  .detail {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .detail-cover {
    max-width: 200px;
    margin: 0 auto;
  }
  .detail-body { padding: 20px; }
  .detail-body h1 { font-size: 22px; }
  .sec-title { font-size: 18px; }
  .cat-item { padding: 8px 14px; font-size: 13px; }
}