/* ============================================================
   世界猛鱼排行榜 · styles.css · free 模式手写
   设计推导（一句话）：数据榜单 × 严谨科普——读者来快速看榜，
   需要清晰层级与可扫读表格。
   七项决定：
   1) 字体：单一无衬线族（PingFang SC / Microsoft YaHei / Noto Sans SC
      + Segoe UI），数字启用 tabular-nums；
   2) 类型尺度：16px 基准、1.25 模数，h1 clamp(2.5rem,6vw,4rem)；
   3) 色板（主色≤2）：纸白 #f8f9f7 底 + 墨蓝黑 #16232e 文字，
      唯一强调色猩红 #c53a2e，灰阶 #5b6773 / #e6e9e8；
   4) 栏宽：1060px；
   5) 留白节奏：section 间距 96px（≤640px 时 64px）；
   6) 图形语言：圆角一档 14px（药丸 999px）、描边一档 1px、
      阴影一档低透明柔光；
   7) 动效 ≤2 种：滚动渐入（fade + 上移 24px）与数字 count-up，
      全局 smooth scroll。
   ============================================================ */

:root {
  --bg: #f8f9f7;
  --panel: #ffffff;
  --ink: #16232e;
  --muted: #5b6773;
  --line: #e6e9e8;
  --accent: #c53a2e;
  --accent-soft: rgba(197, 58, 46, 0.08);
  --shadow: 0 1px 2px rgba(22, 35, 46, 0.05), 0 10px 28px rgba(22, 35, 46, 0.07);
  --radius: 14px;
  --wrap: 1060px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap, .hero-inner, .section, footer .sitemap {
  max-width: var(--wrap);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ---------------------------------------------------------- 导航 */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 24px;
  background: rgba(248, 249, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-nav__brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.site-nav__brand:hover { text-decoration: none; color: var(--accent); }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

.site-nav__item { position: relative; }

.site-nav__list a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.25s ease, background 0.25s ease;
}
.site-nav__list a:hover {
  color: var(--ink);
  text-decoration: none;
  background: rgba(22, 35, 46, 0.05);
}
.site-nav__list a[aria-current="page"],
.site-nav__list a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.site-nav__item--has-sub .site-nav__sub {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 160px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.site-nav__item--has-sub .site-nav__sub a {
  display: block;
  border-radius: 10px;
  white-space: nowrap;
}
.site-nav__item--has-sub:hover .site-nav__sub,
.site-nav__item--has-sub:focus-within .site-nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-toggle { display: none; }
.site-nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  padding: 8px;
  cursor: pointer;
}
.site-nav__burger span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------------------------------------------------------- 头图 */

.hero {
  padding: 96px 0 72px;
  background:
    radial-gradient(900px 380px at 85% -10%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}

.page-head__kicker {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

.page-head__lead {
  max-width: 640px;
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 28px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }

.cta {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.cta:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cta--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.cta--ghost:hover { border-color: var(--ink); }

/* ---------------------------------------------------------- 板块通用 */

.section { padding: 88px 24px 72px; }
.section + .section { border-top: 1px solid var(--line); }
.section, .region-head { scroll-margin-top: 84px; }

.section__kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.section__title { font-size: clamp(1.75rem, 3.5vw, 2.4rem); margin-bottom: 12px; }

.section__lead {
  max-width: 620px;
  color: var(--muted);
  margin-bottom: 40px;
}

/* 滚动渐入（动效 1） */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------- 评选规则 */

.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 48px;
}

.rule-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.rule-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.rule-no {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}
.rule-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.rule-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* 数据条 */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  background: var(--ink);
  border-radius: var(--radius);
  padding: 32px 28px;
}

.stat { text-align: center; }

.stat__num {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  line-height: 1.1;
}
.stat__num .unit {
  font-size: 0.45em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 4px;
}
.stat__label {
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.note {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 3px solid var(--line);
  padding-left: 14px;
}

/* ---------------------------------------------------------- Top 10 榜单 */

.rank-list { display: flex; flex-direction: column; }

.rank-row {
  display: flex;
  gap: 28px;
  padding: 36px 4px;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom: 0; }

.rank-no {
  flex: 0 0 72px;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--accent);
  opacity: 0.9;
}

.rank-main { flex: 1; min-width: 0; }

.rank-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.rank-head h3 { font-size: 1.35rem; margin: 0; }

.latin {
  font-style: italic;
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-block;
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.8rem;
}

.rank-main > p { color: var(--muted); max-width: 720px; }

.rank-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 40px;
  margin-top: 16px;
}

.rstat { min-width: 96px; }

.rstat .num {
  display: inline-block;
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.rstat .unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}
.rstat small {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---------------------------------------------------------- 全图鉴表格 */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.species-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 720px;
}

.species-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: rgba(22, 35, 46, 0.02);
  white-space: nowrap;
}

.species-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.species-table tbody tr:last-child td { border-bottom: 0; }

.species-table tbody tr { transition: background 0.25s ease; }
.species-table tbody tr:hover { background: rgba(22, 35, 46, 0.025); }

.species-table td:first-child { font-weight: 700; white-space: nowrap; }
.species-table th:nth-child(4),
.species-table td:nth-child(4) { white-space: nowrap; }

/* 大洲快速跳转 */
.region-index {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.region-index a {
  display: inline-block;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.88rem;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.region-index a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-2px);
}

.row-mild { color: var(--muted); }
.row-mild td:first-child { font-weight: 600; }

/* 大洲分组标题 */
.region-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 48px 0 18px;
}
.region-head::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 24px;
  background: var(--accent);
  border-radius: 3px;
}
.region-head h3 { margin: 0; font-size: 1.3rem; }
.region-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.species-table tbody.mild { color: var(--muted); }
.species-table tbody.mild td:first-child { font-weight: 600; }

/* ---------------------------------------------------------- 问答 */

.qa { margin: 0; }

.qa dt {
  font-weight: 700;
  font-size: 1.05rem;
  padding-top: 22px;
}
.qa dt::before {
  content: "Q";
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  margin-right: 10px;
}
.qa dd {
  margin: 8px 0 0;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  max-width: 720px;
}
.qa dd:last-child { border-bottom: 0; }

/* ---------------------------------------------------------- 页脚 */

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 56px 0 40px;
  margin-top: 40px;
}

.site-footer__brand {
  max-width: var(--wrap);
  margin: 0 auto 24px;
  padding: 0 24px;
  font-weight: 800;
  font-size: 1.15rem;
}

.site-footer blockquote {
  max-width: var(--wrap);
  margin: 0 auto 32px;
  padding: 0 24px;
  color: var(--muted);
  font-style: italic;
}

.sitemap {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 64px;
  padding-bottom: 32px;
}
.sitemap__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 10px;
}
.sitemap__col a {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  padding: 3px 0;
}
.sitemap__col a:hover { color: var(--accent); text-decoration: none; }

.site-footer__legal {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

/* 翻页（当前未启用，保留契约样式） */
.pager {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.pager a {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 20px;
  color: var(--ink);
}
.pager small { display: block; color: var(--muted); font-size: 0.8rem; }

/* 面包屑（单页未启用，保留契约样式） */
.breadcrumb {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 24px 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb__sep { margin: 0 8px; }

.page-head {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 88px 24px 72px;
}

/* ---------------------------------------------------------- 响应式 */

@media (max-width: 900px) {
  .site-nav { flex-wrap: wrap; }
  .site-nav__burger { display: flex; }

  .site-nav__list {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 12px;
  }
  .nav-toggle:checked ~ .site-nav__list { display: flex; }

  .nav-toggle:checked ~ .site-nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .site-nav__burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .site-nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-nav__item--has-sub .site-nav__sub {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0 0 0 16px;
  }

  .rules-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: repeat(2, 1fr); padding: 28px 20px; }
  .hero { padding: 72px 0 56px; }
  .section { padding: 64px 24px 56px; }
}

@media (max-width: 640px) {
  .rules-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .rank-row { flex-direction: row; gap: 18px; padding: 28px 0; }
  .rank-no { flex-basis: 48px; }
  .rank-stats { gap: 12px 24px; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 56px 20px 48px; }
}

/* 尊重系统减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .rule-card, .cta { transition: none; }
}
