:root {
  --bg: #141416;
  --surface: #1E1E22;
  --primary: #FF5F1F;
  --accent: #FFB800;
  --text: #E8E8EA;
  --muted: #8A8A94;
  --radius: 6px;
  --line: #2A2A30;
  --font-heading: 'IBM Plex Mono', 'Courier New', monospace;
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --wrap: 1200px;
}

* { 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;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.008) 0 1px, transparent 1px 4px);
}

a { color: inherit; text-decoration: none; transition: color .2s linear; }
a:hover { color: var(--primary); }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
}

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

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20,20,22,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .04em;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 1px;
  margin-right: 8px;
  vertical-align: middle;
  transform: translateY(-2px);
}
.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: 6px 12px;
  font-size: 14px;
  color: var(--muted);
  border-radius: var(--radius);
  white-space: nowrap;
  border: 1px solid transparent;
}
.nav a:hover,
.nav a.active {
  color: var(--primary);
  border-color: rgba(255,95,31,.35);
  background: rgba(255,95,31,.06);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  width: 160px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  background: var(--primary);
  border: none;
  color: #141416;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  transition: background .2s linear;
}
.search-box button:hover { background: var(--accent); }

/* ===== Hero 轮播 ===== */
.hero {
  position: relative;
  margin: 24px auto 40px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.hero-slide {
  position: relative;
  display: block;
  aspect-ratio: 21 / 9;
  overflow: hidden;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s linear;
}
.hero-slide:hover img { transform: scale(1.03); }
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20,20,22,.92) 0%, rgba(20,20,22,.55) 45%, transparent 75%),
              linear-gradient(0deg, rgba(20,20,22,.85) 0%, transparent 50%);
  pointer-events: none;
}

.hero-info {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 32px;
  max-width: 560px;
}
.hero-info h2 {
  font-size: 28px;
  margin-bottom: 10px;
  color: var(--text);
}
.hero-info p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 10px 22px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #141416;
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: all .2s linear;
}
.btn:hover {
  background: transparent;
  color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 0 18px rgba(255,95,31,.35);
}

/* ===== Section ===== */
.sec { margin-bottom: 44px; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.sec-title {
  font-size: 20px;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}
.sec-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 1px;
}

.sec-more {
  font-family: var(--font-heading);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.sec-more::after { content: " →"; color: var(--primary); }
.sec-more:hover { color: var(--primary); }

/* ===== Grid & Card ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .22s linear, border-color .22s linear, box-shadow .22s linear;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,95,31,.55);
  box-shadow: 0 0 0 1px rgba(255,95,31,.35), 0 8px 24px rgba(0,0,0,.45);
}

.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0e0e10;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s linear;
}
.card:hover .card-cover img { transform: scale(1.05); }

.card-score {
  position: absolute;
  top: 8px;
  right: 0;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: #141416;
  background: var(--accent);
  padding: 3px 10px 3px 8px;
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
  letter-spacing: .02em;
}

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

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-heading);
  display: flex;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== 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: 6px;
  padding: 20px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text);
  transition: all .2s linear;
}
.cat-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 14px rgba(255,95,31,.25);
}

.cat-count {
  font-size: 12px;
  color: var(--muted);
}
.cat-item:hover .cat-count { color: var(--accent); }

/* ===== Rank list ===== */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s linear;
}
.rank-item:hover {
  border-color: rgba(255,95,31,.5);
  transform: translateX(3px);
}

.rank-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
}
.rank-item:nth-child(1) .rank-num { color: var(--primary); }
.rank-item:nth-child(2) .rank-num { color: var(--accent); }
.rank-item:nth-child(3) .rank-num { color: #d0d0d6; }

.rank-title {
  flex: 1;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== Detail ===== */
.detail {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin: 32px 0 44px;
}

.detail-head { display: contents; }

.detail-cover {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0e0e10;
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-meta h1 {
  font-size: 26px;
  color: var(--text);
  line-height: 1.3;
}
.detail-meta p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.detail-meta p strong {
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-right: 4px;
}

.detail-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #141416;
  background: var(--accent);
  padding: 4px 14px;
  border-radius: var(--radius);
  align-self: flex-start;
}

.detail-body {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}
.detail-body h2 {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 12px;
}
.detail-body p { margin-bottom: 12px; }

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

.tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--muted);
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s linear;
}
.tag:hover {
  color: var(--primary);
  border-color: rgba(255,95,31,.5);
}

/* ===== Pager ===== */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 40px 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: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s linear;
}
.pg:hover {
  color: var(--primary);
  border-color: rgba(255,95,31,.5);
}
.pg.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #141416;
  font-weight: 700;
}
.pg.disabled {
  opacity: .35;
  pointer-events: none;
  cursor: not-allowed;
}

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

.link-item {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all .2s linear;
}
.link-item:hover {
  color: var(--primary);
  border-color: rgba(255,95,31,.5);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 32px 0 24px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.9;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--primary); }
.footer .wrap { display: flex; flex-direction: column; gap: 8px; align-items: center; }

/* ===== Crumbs ===== */
.crumbs {
  font-family: var(--font-heading);
  font-size: 12px;
  color: var(--muted);
  padding: 18px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs span { color: var(--muted); }

/* ===== Highlight ===== */
.hl {
  color: var(--primary);
  background: rgba(255,95,31,.12);
  padding: 0 2px;
  border-radius: 2px;
}

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

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

  .header .wrap {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .logo { font-size: 18px; }
  .nav {
    order: 3;
    width: 100%;
    flex: 0 0 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    gap: 2px;
  }
  .nav a { padding: 5px 10px; font-size: 13px; }
  .search-box { margin-left: auto; }
  .search-box input { width: 110px; padding: 7px 10px; }

  .hero { margin: 16px auto 28px; }
  .hero-slide { aspect-ratio: 16 / 10; }
  .hero-info { padding: 18px; max-width: 100%; }
  .hero-info h2 { font-size: 20px; }
  .hero-info p { font-size: 13px; -webkit-line-clamp: 2; }
  .btn { padding: 8px 16px; font-size: 12px; }

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

  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .card-info { padding: 8px 9px 10px; }
  .card-title { font-size: 13px; }
  .card-meta { font-size: 11px; gap: 6px; }

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

  .rank-list { grid-template-columns: 1fr; gap: 8px; }
  .rank-item { padding: 10px 12px; }
  .rank-num { font-size: 17px; min-width: 28px; }

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

  .pager { gap: 6px; margin: 28px 0; }
  .pg { min-width: 34px; height: 34px; padding: 0 9px; font-size: 12px; }

  .footer { padding: 24px 0 18px; font-size: 12px; }
}

@media (max-width: 400px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cat-list { grid-template-columns: repeat(2, 1fr); }
  .search-box input { width: 90px; }
}