:root {
  --bg: #F4EBD9;
  --surface: #FBF6EA;
  --primary: #C0392B;
  --accent: #1F3A93;
  --text: #1E1B16;
  --muted: #8A7E6B;
  --radius: 6px;
  --border: 2px solid var(--text);
  --shadow: 4px 4px 0 var(--text);
  --shadow-primary: 4px 4px 0 var(--primary);
  --font-heading: 'Arial Black', 'Helvetica Neue', Impact, 'Noto Sans SC', sans-serif;
  --font-body: 'Avenir Next', 'Segoe UI', 'Noto Sans SC', sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.02) 0%, transparent 50%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

a {
  color: inherit;
  text-decoration: none;
}

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

ul, ol {
  list-style: none;
}

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

/* ===== Header ===== */
.header {
  background: var(--surface);
  border-bottom: var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--primary);
  text-transform: uppercase;
  white-space: nowrap;
  border: var(--border);
  padding: 4px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-primary);
  background: var(--surface);
  line-height: 1.2;
}

.logo a {
  color: inherit;
}

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

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

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

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

.search-box {
  display: flex;
  align-items: stretch;
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  outline: none;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  width: 160px;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--muted);
}

.search-box button {
  border: none;
  border-left: var(--border);
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.5px;
}

.search-box button:hover {
  background: var(--accent);
}

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

.hero-slide {
  position: relative;
  display: none;
}

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

.hero-slide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.hero-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 20px;
  background: linear-gradient(to top, rgba(30,27,22,0.92) 0%, rgba(30,27,22,0.6) 60%, transparent 100%);
  color: #fff;
}

.hero-info h2,
.hero-info h3 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  line-height: 1.2;
  margin-bottom: 6px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.4);
}

.hero-info p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  border: 2px solid var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--text);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--text);
}

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

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

.sec-head::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--primary);
}

.sec-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 2px solid var(--text);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.sec-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 4px 14px;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

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

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

.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 var(--text);
}

.card-cover {
  position: relative;
  width: 100%;
  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 0.3s;
}

.card:hover .card-cover img {
  transform: scale(1.05);
}

.card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  padding: 3px 10px;
  border: 2px solid var(--text);
  box-shadow: 2px 2px 0 var(--text);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 85%, 0 100%);
  padding-bottom: 8px;
  line-height: 1.2;
  z-index: 2;
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

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

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

/* ===== Category List ===== */
.cat-list {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 8px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: center;
}

.cat-item:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--primary);
  background: var(--primary);
  color: #fff;
}

.cat-item a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 900;
  color: inherit;
}

.cat-count {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.cat-item:hover .cat-count {
  color: rgba(255,255,255,0.8);
}

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

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

.rank-item:hover {
  transform: translateX(4px);
  box-shadow: 6px 6px 0 var(--primary);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  background: var(--primary);
  border: 2px solid var(--text);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--text);
}

.rank-item:nth-child(1) .rank-num { background: #C0392B; }
.rank-item:nth-child(2) .rank-num { background: #1F3A93; }
.rank-item:nth-child(3) .rank-num { background: #8A7E6B; }

.rank-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.rank-score {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 900;
  color: var(--primary);
  flex-shrink: 0;
}

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

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

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

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

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

.detail-meta h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
}

.detail-meta p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: #fff;
  background: var(--primary);
  border: 2px solid var(--text);
  padding: 4px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  align-self: flex-start;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
  padding-bottom: 10px;
}

.detail-body {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  line-height: 1.8;
  font-size: 0.95rem;
}

.detail-body h2,
.detail-body h3 {
  font-family: var(--font-heading);
  margin: 16px 0 8px;
  color: var(--text);
}

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

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

.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--text);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--text);
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--text);
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.pg:hover {
  background: var(--primary);
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--text);
}

.pg.current {
  background: var(--primary);
  color: #fff;
  pointer-events: none;
}

.pg.disabled {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
}

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

.link-item {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 4px 10px;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s;
}

.link-item:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ===== Footer ===== */
.footer {
  margin-top: 48px;
  padding: 28px 0;
  background: var(--surface);
  border-top: 3px solid var(--text);
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.8;
}

.footer a {
  color: var(--primary);
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== Crumbs ===== */
.crumbs {
  padding: 14px 0;
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.crumbs a {
  color: var(--accent);
  font-weight: 600;
}

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

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

/* ===== Highlight ===== */
.hl {
  background: var(--primary);
  color: #fff;
  padding: 0 3px;
  border-radius: 2px;
  font-weight: 700;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .cat-list {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

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

  .logo {
    font-size: 1.15rem;
    padding: 3px 8px;
    box-shadow: 3px 3px 0 var(--primary);
  }

  .nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    gap: 2px;
    padding-bottom: 4px;
  }

  .nav a {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

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

  .search-box input {
    width: 110px;
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .search-box button {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .hero {
    margin: 16px 0;
  }

  .hero-slide img {
    aspect-ratio: 4 / 3;
  }

  .hero-info {
    padding: 30px 14px 14px;
  }

  .hero-info h2,
  .hero-info h3 {
    font-size: 1.15rem;
  }

  .hero-info p {
    font-size: 0.8rem;
    -webkit-line-clamp: 1;
  }

  .btn {
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  .sec {
    margin: 24px 0;
  }

  .sec-title {
    font-size: 1.1rem;
  }

  .sec-more {
    font-size: 0.75rem;
    padding: 3px 10px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-info {
    padding: 8px 10px 10px;
  }

  .card-title {
    font-size: 0.85rem;
  }

  .card-meta {
    font-size: 0.7rem;
  }

  .cat-list {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .cat-item {
    padding: 12px 6px;
  }

  .cat-item a {
    font-size: 0.8rem;
  }

  .rank-item {
    padding: 8px 10px;
    gap: 10px;
  }

  .rank-num {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }

  .rank-title {
    font-size: 0.85rem;
  }

  .rank-score {
    font-size: 0.9rem;
  }

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

  .detail-cover {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }

  .detail-meta h1 {
    font-size: 1.3rem;
  }

  .detail-score {
    font-size: 1.1rem;
    padding: 3px 12px 8px;
  }

  .detail-body {
    padding: 16px;
    font-size: 0.9rem;
  }

  .pg {
    min-width: 32px;
    height: 32px;
    font-size: 0.78rem;
    padding: 0 8px;
  }

  .footer {
    margin-top: 32px;
    padding: 20px 0;
    font-size: 0.75rem;
  }
}

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