:root {
  --bg: #F7F1E4;
  --surface: #FFFCF4;
  --primary: #D24B2A;
  --accent: #E8B23A;
  --text: #221E1B;
  --muted: #8A7F72;
  --line: #E3D9C6;
  --radius: 6px 22px 8px 18px;
  --radius-sm: 4px 14px 6px 12px;
  --shadow: 5px 5px 0 rgba(34, 30, 27, 0.14);
  --shadow-hover: 8px 10px 0 rgba(34, 30, 27, 0.2);
  --font-head: Georgia, 'Noto Serif SC', 'Songti SC', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  background-image:
    linear-gradient(135deg, rgba(210, 75, 42, 0.04) 25%, transparent 25%),
    linear-gradient(225deg, rgba(232, 178, 58, 0.05) 25%, transparent 25%);
  background-size: 46px 46px;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.25; }

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

/* ---------- Header ---------- */
.header {
  background: var(--surface);
  border-bottom: 3px solid var(--text);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 3px 0 rgba(232, 178, 58, 0.55);
}

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

.logo {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--primary);
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--accent);
}

.logo img { height: 34px; width: auto; }

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

.nav a {
  display: inline-block;
  padding: 6px 13px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.nav a:hover {
  background: var(--accent);
  border-color: var(--text);
  color: var(--text);
}

.search-box {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 3px 3px 0 rgba(210, 75, 42, 0.25);
}

.search-box input {
  border: 0;
  outline: 0;
  padding: 7px 12px;
  width: 170px;
  font-family: var(--font-body);
  font-size: 14px;
  background: transparent;
  color: var(--text);
}

.search-box button {
  border: 0;
  border-left: 2px solid var(--text);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.18s;
}
.search-box button:hover { background: #b83e20; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  margin: 26px 0 10px;
  border: 3px solid var(--text);
  border-radius: var(--radius);
  background: var(--text);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 300px;
}

.hero-slide {
  position: relative;
  display: none;
}
.hero-slide:first-child,
.hero-slide.active { display: block; }

.hero-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  opacity: 0.92;
}

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 60px 30px 26px;
  background: linear-gradient(to top, rgba(34, 30, 27, 0.94), rgba(34, 30, 27, 0.55) 55%, transparent);
  color: #fff;
}

.hero-info h2 {
  font-size: 30px;
  margin-bottom: 8px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
}

.hero-info p {
  margin: 0 0 14px;
  font-size: 14px;
  color: #EADFCB;
  max-width: 640px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--accent);
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 var(--primary);
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s;
}
.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--primary);
}
.btn.ghost {
  background: transparent;
  color: #fff;
  border-color: #fff;
  box-shadow: 3px 3px 0 rgba(232, 178, 58, 0.7);
}

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

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--text);
  position: relative;
}

.sec-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 90px;
  height: 6px;
  background: var(--primary);
  border-radius: 3px;
}

.sec-title {
  font-size: 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sec-title::before {
  content: "";
  width: 12px;
  height: 22px;
  background: var(--accent);
  border: 2px solid var(--text);
  border-radius: 3px;
  transform: skewX(-12deg);
}

.sec-more {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  padding: 4px 12px;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.18s, color 0.18s;
}
.sec-more:hover { background: var(--primary); color: #fff; }

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

.card {
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: var(--shadow-hover);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--text);
  overflow: hidden;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.card:hover .card-cover img { transform: scale(1.06); }

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 38px;
  height: 38px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(34, 30, 27, 0.45);
}

.card-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

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

.card-meta span {
  background: rgba(232, 178, 58, 0.22);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 6px;
  line-height: 1.6;
}

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

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(210, 75, 42, 0.22);
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.cat-item:hover {
  background: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(34, 30, 27, 0.3);
}

.cat-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--surface);
  background: var(--primary);
  border-radius: 999px;
  padding: 1px 9px;
  flex-shrink: 0;
}

/* ---------- Rank list ---------- */
.rank-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.rank-item:hover {
  transform: translateX(4px);
  box-shadow: -4px 4px 0 rgba(232, 178, 58, 0.6);
}

.rank-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--surface);
  background: var(--text);
  border-radius: 50%;
  border: 2px solid var(--text);
}
.rank-item:nth-child(1) .rank-num { background: var(--primary); }
.rank-item:nth-child(2) .rank-num { background: var(--accent); color: var(--text); }
.rank-item:nth-child(3) .rank-num { background: #C98A3F; }

.rank-title {
  flex: 1 1 auto;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  flex-shrink: 0;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

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

.detail-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  background: var(--surface);
  border: 3px solid var(--text);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}

.detail-head::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 10px;
  background: var(--accent);
  border-radius: var(--radius) 0 10px 0;
}

.detail-cover {
  aspect-ratio: 2 / 3;
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--text);
  box-shadow: 4px 4px 0 rgba(210, 75, 42, 0.3);
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.detail-meta h1 {
  font-size: 28px;
  line-height: 1.25;
}

.detail-meta .sub {
  font-size: 14px;
  color: var(--muted);
}

.detail-meta dl {
  margin: 0;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 6px 12px;
  font-size: 14px;
}
.detail-meta dt { color: var(--muted); font-weight: 700; }
.detail-meta dd { margin: 0; }

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 16px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  background: var(--accent);
  border: 2px solid var(--text);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--primary);
}

.detail-body {
  margin-top: 26px;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.85;
}
.detail-body h2 {
  font-size: 19px;
  margin: 0 0 12px;
  padding-left: 12px;
  border-left: 5px solid var(--primary);
}
.detail-body p { margin: 0 0 14px; }
.detail-body img { border-radius: var(--radius-sm); margin: 10px 0; }

/* ---------- Tags ---------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag {
  display: inline-block;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: rgba(232, 178, 58, 0.25);
  border: 1.5px solid var(--text);
  border-radius: 999px;
  transition: background 0.18s, color 0.18s;
}
.tag:hover { background: var(--primary); color: #fff; }

/* ---------- Pager ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 34px 0 10px;
}

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0 rgba(34, 30, 27, 0.15);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}
.pg:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.pg.current {
  background: var(--primary);
  color: #fff;
  border-color: var(--text);
  box-shadow: 3px 3px 0 var(--accent);
  cursor: default;
}

.pg.disabled {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
  pointer-events: none;
  opacity: 0.65;
}

/* ---------- Links ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 0;
}

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 3px 12px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.link-item:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(210, 75, 42, 0.06);
}

/* ---------- Crumbs ---------- */
.crumbs {
  margin: 20px 0 4px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crumbs a { color: var(--primary); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--line); }

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

/* ---------- Footer ---------- */
.footer {
  margin-top: 50px;
  padding: 30px 0 34px;
  background: var(--text);
  color: #D9CFC0;
  border-top: 6px solid var(--accent);
  font-size: 13px;
}
.footer a { color: #F0E6D6; }
.footer a:hover { color: var(--accent); }
.footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.footer .f-logo {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}
.footer .f-desc { color: var(--muted); max-width: 640px; }
.footer .f-links { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  body { font-size: 14px; }

  .wrap { padding: 0 14px; }

  .header .wrap {
    gap: 10px;
    min-height: 0;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .logo { font-size: 19px; }

  .nav {
    order: 3;
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    border-top: 1px solid var(--line);
    padding-top: 6px;
  }
  .nav a { padding: 5px 11px; font-size: 13px; }

  .search-box { flex: 1 1 auto; }
  .search-box input { width: 100%; min-width: 0; }

  .hero { margin-top: 16px; min-height: 0; }
  .hero-slide img { height: 260px; }
  .hero-info { padding: 40px 16px 18px; }
  .hero-info h2 { font-size: 21px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }

  .sec { margin: 28px 0; }
  .sec-title { font-size: 18px; }
  .sec-more { font-size: 12px; padding: 3px 9px; }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card-title { font-size: 14px; }
  .card-score { min-width: 32px; height: 32px; font-size: 13px; top: 6px; right: 6px; }

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

  .rank-item { padding: 8px 12px; gap: 10px; }
  .rank-num { width: 28px; height: 28px; font-size: 14px; }
  .rank-title { font-size: 14px; }

  .detail-head {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 22px; }
  .detail-meta dl { grid-template-columns: 66px 1fr; font-size: 13px; }

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

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

  .footer { margin-top: 34px; padding: 24px 0 28px; }
}