:root {
  --bg: #EDE4D0;
  --surface: #F8F1E0;
  --primary: #1E1C1A;
  --accent: #D9481C;
  --text: #1E1C1A;
  --muted: #7A6A58;
  --radius: 10px;
  --font-heading: 'Courier New', 'Noto Sans SC', monospace;
  --font-body: 'Noto Sans SC', 'PingFang SC', sans-serif;
  --shadow: 4px 4px 0 var(--accent);
  --shadow-sm: 2px 2px 0 var(--accent);
  --border: 2px solid var(--primary);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  background-image:
    radial-gradient(rgba(30,28,26,.05) 1px, transparent 1px),
    radial-gradient(rgba(30,28,26,.04) 1px, transparent 1px);
  background-size: 6px 6px, 11px 11px;
  background-position: 0 0, 3px 3px;
}

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 16px;
}

/* ============ HEADER ============ */
.header {
  background: var(--surface);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--primary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo::before {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--accent);
  transform: skewX(-12deg);
  box-shadow: var(--shadow-sm);
}
.logo img { height: 32px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--font-heading);
  font-size: 14px;
  padding: 6px 12px;
  white-space: nowrap;
  border-radius: var(--radius);
  color: var(--primary);
  transition: background .2s, color .2s;
}
.nav a:hover {
  background: var(--accent);
  color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  align-items: center;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  padding: 7px 12px;
  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(--accent);
  color: var(--surface);
  padding: 7px 14px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
}
.search-box button:hover { background: var(--primary); }

/* ============ HERO ============ */
.hero {
  position: relative;
  margin: 22px 0;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.hero-slide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
  align-items: center;
}
.hero-slide .hero-pic {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
}
.hero-slide .hero-pic img { width: 100%; height: 100%; object-fit: cover; }
.hero-info { display: flex; flex-direction: column; gap: 12px; }
.hero-info h2 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.25;
  color: var(--primary);
}
.hero-info p {
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-info .hero-meta {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}

.btn {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  padding: 9px 20px;
  background: var(--accent);
  color: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--primary);
}
.btn:active { transform: translate(1px, 1px); box-shadow: none; }

/* ============ SECTION ============ */
.sec { margin: 32px 0; }
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--primary);
}
.sec-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-title::before {
  content: "";
  width: 8px;
  height: 22px;
  background: var(--accent);
  transform: skewX(-14deg);
  box-shadow: 2px 2px 0 var(--primary);
}
.sec-more {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: 3px 12px;
  transition: all .2s;
}
.sec-more:hover { color: var(--surface); background: var(--primary); border-color: var(--primary); }

/* ============ GRID & CARD ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg);
  border-bottom: var(--border);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.card:hover .card-cover img { transform: scale(1.05); }
.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--accent);
  color: var(--surface);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--primary);
}
.card-info { padding: 10px 10px 12px; }
.card-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}
.card-meta span { white-space: nowrap; }

/* ============ CAT LIST ============ */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-item {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .15s, background .2s, color .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cat-item:hover {
  background: var(--accent);
  color: var(--surface);
  transform: translateY(-2px) skewX(-3deg);
}
.cat-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 0 7px;
}
.cat-item:hover .cat-count { color: var(--primary); background: var(--surface); }

/* ============ RANK LIST ============ */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: transform .15s, box-shadow .15s;
}
.rank-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.rank-num {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--surface);
  border-radius: var(--radius);
  transform: skewX(-8deg);
  flex-shrink: 0;
}
.rank-item:nth-child(-n+3) .rank-num { background: var(--accent); }
.rank-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ============ DETAIL ============ */
.detail { margin: 24px 0; }
.detail-head {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 26px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: var(--border);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta { display: flex; flex-direction: column; gap: 12px; }
.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 26px;
  line-height: 1.3;
  color: var(--primary);
}
.detail-meta .detail-sub { color: var(--muted); font-size: 14px; }
.detail-score {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--surface);
  background: var(--accent);
  padding: 4px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
}
.detail-meta dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 14px;
}
.detail-meta dt { color: var(--muted); font-family: var(--font-heading); }
.detail-meta dd { color: var(--text); }
.detail-body {
  margin-top: 22px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  line-height: 1.85;
  font-size: 15px;
}
.detail-body h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  margin: 18px 0 10px;
  padding-left: 12px;
  border-left: 5px solid var(--accent);
}
.detail-body h2:first-child { margin-top: 0; }
.detail-body p { margin-bottom: 12px; color: var(--text); }

/* ============ TAG LIST ============ */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--font-heading);
  font-size: 12px;
  padding: 3px 12px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  color: var(--muted);
  transition: all .2s;
}
.tag:hover { background: var(--accent); border-color: var(--accent); color: var(--surface); }

/* ============ PAGER ============ */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 28px 0;
}
.pg {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  color: var(--primary);
  transition: all .15s;
}
.pg:hover { background: var(--accent); color: var(--surface); transform: translateY(-2px); }
.pg.current {
  background: var(--primary);
  color: var(--surface);
  box-shadow: var(--shadow-sm);
}
.pg.disabled {
  opacity: .4;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============ LINKS ============ */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 16px 0;
}
.link-item {
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px dashed var(--muted);
  transition: color .2s, border-color .2s;
}
.link-item:hover { color: var(--accent); border-color: var(--accent); }

/* ============ FOOTER ============ */
.footer {
  margin-top: 40px;
  background: var(--primary);
  color: var(--bg);
  border-top: 4px solid var(--accent);
  padding: 26px 0 20px;
  font-size: 13px;
}
.footer .wrap { display: flex; flex-direction: column; gap: 10px; }
.footer a { color: var(--bg); opacity: .85; }
.footer a:hover { color: var(--accent); opacity: 1; }
.footer .footer-info { color: rgba(237,228,208,.6); font-family: var(--font-heading); font-size: 12px; }

/* ============ CRUMBS ============ */
.crumbs {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  padding: 16px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.crumbs a { color: var(--primary); }
.crumbs a:hover { color: var(--accent); }

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

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .detail-head { grid-template-columns: 200px 1fr; }
}

@media (max-width: 768px) {
  .header .wrap { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .logo { font-size: 17px; }
  .nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .nav a { padding: 5px 10px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }
  .hero-info h2 { font-size: 20px; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-title { font-size: 13px; }

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

  .detail-head {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }
  .detail-cover { max-width: 200px; margin: 0 auto; }
  .detail-meta h1 { font-size: 20px; }
  .detail-body { padding: 16px; }

  .sec-title { font-size: 17px; }
  .sec-more { font-size: 12px; }
}