/* ==========================================================================
   水产甲壳类种大全 · 首页样式
   设计基准宽度 1440px；区块高度来自 03-ui/compare-log.md 的分区预算。
   ========================================================================== */

/* ------------------------------------------------------------------ 变量 */
/* 所有颜色 / 字号 / 圆角 / 栅格变量在 tokens.css 里定义，本文件不再重复声明。 */

/* ------------------------------------------------------------------ 基础 */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink-body);
  font-family:'PingFang SC','Microsoft YaHei','Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 700; letter-spacing: .01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
b { font-weight: 700; }

.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 10px 16px;
  background: var(--navy);
  color: var(--ink-invert);
  font-size: var(--fs-sm);
}
.skip-link:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ------------------------------------------------------------- M0 页头 */
.site-header {
  background: var(--navy);
  color: var(--ink-invert);
  height: 72px;
}
.header-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-invert); }
.brand-mark { display: inline-flex; color: var(--hero-bg); }
.brand-name { font-size: var(--fs-h3); font-weight: 700; letter-spacing: .02em; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: var(--fs-sm);
  color: var(--ink-invert-soft);
}
.site-nav a { padding: 4px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.site-nav a:hover { color: #fff; border-bottom-color: var(--hero-bg); }
.site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--orange); }

/* 导航下拉 */
.nav-item { position: relative; }
.nav-item > a { display: inline-flex; align-items: center; gap: 5px; }
.nav-caret {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .7;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: -14px;
  z-index: 50;
  min-width: 168px;
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 12px 28px rgba(11, 47, 82, .16);
}
.dropdown-menu a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-size: var(--fs-cap);
  color: var(--ink-body);
}
.dropdown-menu a:hover { background: var(--panel-blue); color: var(--navy); text-decoration: none; }
.nav-item.dropdown:hover .dropdown-menu { display: block; }

/* ------------------------------------------------------- M1 首屏主视觉 */
.hero {
  position: relative;
  background: var(--hero-bg);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  top: 0;
  bottom: 0;
  right: max(0px, calc((100% - var(--wrap)) / 2));
  width: 44.7%;
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
.hero-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-height: 316px;
  padding-top: 32px;
  padding-bottom: 12px;
}
.hero-copy {
  width: 476px;
  max-width: 52%;
  padding-left: 12px;
}
.eyebrow {
  font-size: var(--fs-micro);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(11, 47, 82, .55);
  margin-bottom: 8px;
}
.hero h1 {
  font-size: var(--fs-h1);
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--ink);
}
.hero-lead {
  margin-top: 23px;
  font-size: var(--fs-lead);
  line-height: 1.62;
  color: #123a5e;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-primary { background: var(--navy-3); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-ghost { color: var(--navy-2); border-color: rgba(18, 57, 96, .3); }
.btn-ghost:hover { background: rgba(255, 255, 255, .55); }
.btn-accent { background: var(--orange); color: #1a1206; }
.btn-accent:hover { background: #d97f0b; }
.sep-dot { color: rgba(11, 47, 82, .45); font-size: var(--fs-sm); }
.btn-ghost-light { color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .12); }

.hero-stats {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  font-size: var(--fs-cap);
  color: rgba(11, 47, 82, .7);
}
.hero-stats b { font-size: var(--fs-h3); color: var(--ink); margin-right: 1px; }
.stat-sep { color: rgba(11, 47, 82, .32); }

/* ------------------------------------------------------- 区块通用标题 */
.section { padding-top: 21px; }
.section-title {
  font-size: var(--fs-h2);
  line-height: 1.25;
  letter-spacing: .01em;
}

/* -------------------------------------------------- M2 分类索引（six 列）*/
.categories { padding-top: 26px; padding-bottom: 45px; }
.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--col-gap);
  margin-top: 32px;
}
.cat-item { display: block; }
.cat-thumb {
  display: block;
  aspect-ratio: 233 / 71;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--panel-soft);
}
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.cat-item:hover .cat-thumb img { transform: scale(1.04); }
.cat-item h3 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 22px;
  font-size: 18px;
  line-height: 1.35;
}
.cat-num {
  font-size: var(--fs-cap);
  font-weight: 600;
  color: var(--navy-2);
  letter-spacing: .04em;
}
.cat-item p {
  margin-top: 17px;
  max-width: 192px;
  font-size: var(--fs-cap);
  line-height: 1.62;
  color: var(--ink-muted);
}

/* ---------------------------------------------------- M3 品种速览（6×2）*/
.species { padding-top: 12px; padding-bottom: 3px; }
.species-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px var(--col-gap);
  margin-top: 13px;
}
.species-card { display: block; }
.species-thumb {
  display: block;
  aspect-ratio: 233 / 88;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--panel-soft);
}
.species-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.species-card:hover .species-thumb img { transform: scale(1.05); }
.species-card h3 {
  margin-top: 8px;
  font-size: var(--fs-sm);
  line-height: 1.3;
}
.species-card p {
  margin-top: 2px;
  font-size: var(--fs-micro);
  line-height: 1.3;
  color: var(--ink-muted);
}

/* --------------------------------------------------------- M4 四步辨识 */
.identify { padding-top: 4px; padding-bottom: 17px; }
.step-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 16px;
}
.step-card {
  background: var(--panel-blue);
  border-radius: var(--r-md);
  padding: 22px 18px 24px;
  min-height: 145px;
}
.step-card h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--fs-h3);
  line-height: 1.3;
}
.step-num {
  font-size: var(--fs-cap);
  color: var(--navy-2);
  font-weight: 600;
  letter-spacing: .04em;
}
.step-card p {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.62;
  color: var(--ink-body);
}

/* ------------------------------------------------------- M5 季节与蜕壳 */
.season { padding-top: 4px; padding-bottom: 11px; }
.season-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 10px;
}
.season-card {
  border-radius: var(--r-md);
  padding: 22px 18px 24px;
  min-height: 155px;
}
.season-spring { background: var(--panel-green); }
.season-summer { background: var(--panel-cream); }
.season-autumn { background: var(--panel-cream); }
.season-winter { background: var(--panel-sky); }
.season-card h3 { font-size: var(--fs-h3); line-height: 1.3; }
.season-card p {
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.62;
  color: var(--ink-body);
}

/* --------------------------------------------------------- M6 水域对照 */
.habitat { padding-top: 4px; padding-bottom: 43px; }
.habitat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.habitat-thumb {
  display: block;
  aspect-ratio: 310 / 78;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--panel-soft);
}
.habitat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.habitat-card h3 { margin-top: 13px; font-size: var(--fs-base); line-height: 1.35; }
.habitat-card p {
  margin-top: 10px;
  font-size: var(--fs-micro);
  line-height: 1.45;
  color: var(--ink-muted);
}
/* 首列略宽，与稿一致 */
.habitat-card:first-child { grid-column: span 1; }

/* --------------------------------------------------------- M7 收录说明 */
.scope { padding-top: 7px; padding-bottom: 27px; }
.scope-panel {
  background: var(--panel-soft);
  border-radius: var(--r-md);
  padding: 24px 26px 26px;
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 24px;
}
.scope-panel h2 { font-size: 17px; line-height: 1.3; }
.scope-copy p {
  font-size: var(--fs-sm);
  line-height: 1.62;
  color: var(--ink-body);
}
.scope-copy p + p { margin-top: 6px; color: var(--ink-muted); }

/* ------------------------------------------------------------- M8 收尾 */
.cta { padding-top: 7px; padding-bottom: 16px; }
.cta-panel {
  display: grid;
  grid-template-columns: 1fr 372px;
  height: 137px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--navy-2);
}
.cta-copy { color: var(--ink-invert); padding: 18px 26px 20px; }
.cta-copy h2 { color: #fff; font-size: var(--fs-h3-lg); line-height: 1.3; }
.cta-copy p {
  margin-top: 7px;
  font-size: var(--fs-cap);
  line-height: 1.5;
  color: var(--ink-invert-soft);
  max-width: 620px;
}
.cta-actions { display: flex; gap: 10px; margin-top: 12px; }
.cta-media img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------- M9 页脚 */
.site-footer {
  background: var(--navy);
  color: var(--ink-invert-soft);
  padding-top: 22px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 2px;
}
.footer-brand { flex: 1.4 1 240px; min-width: 200px; }
.footer-col { flex: 1 1 160px; min-width: 140px; }
.footer-about { flex: 1.6 1 260px; min-width: 220px; }
.footer-name { font-size: 17px; font-weight: 700; color: #fff; }
.footer-tag {
  margin-top: 6px;
  font-size: var(--fs-cap);
  line-height: 1.45;
  max-width: 300px;
}
.footer-head {
  font-size: var(--fs-micro);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 6px;
  line-height: 1.5;
}
.footer-col a {
  display: block;
  font-size: var(--fs-cap);
  line-height: 1.5;
  padding: 0;
  color: var(--ink-invert-soft);
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-about p { font-size: var(--fs-cap); line-height: 1.36; }
.footer-about p + p { margin-top: 6px; color: rgba(255, 255, 255, .62); }
.footer-base {
  border-top: 1px solid var(--line-invert);
  padding-top: 8px;
  padding-bottom: 6px;
  font-size: var(--fs-micro);
  color: rgba(255, 255, 255, .55);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
}
.footer-icp { white-space: nowrap; color: rgba(255, 255, 255, .55); }
.footer-icp:hover { color: #fff; }

/* ------------------------------------------------------------- 响应式 */
@media (max-width: 1200px) {
  :root { --gutter: 24px; }
  .site-nav { gap: 16px; }
  .hero-copy { width: 44%; max-width: 44%; }
  .hero h1 { font-size: 34px; }
  .cat-grid { gap: 14px 6px; }
  .species-grid { gap: 20px 6px; }
  .step-grid { gap: 14px; }
  .season-grid { gap: 16px; }
  .habitat-grid { gap: 14px; }
  .scope-panel { grid-template-columns: 148px 1fr; gap: 18px; }
  .cta-panel { grid-template-columns: 1fr 300px; }
  .footer-inner { gap: 32px; }
}

@media (max-width: 1024px) {
  /* 已移除汉堡按钮：导航常显并允许换行 */
  .site-header { height: auto; position: relative; }
  .header-inner { height: auto; flex-wrap: wrap; justify-content: flex-start; gap: 10px 20px; padding-top: 12px; padding-bottom: 10px; }
  .site-nav { flex-wrap: wrap; gap: 6px 18px; width: 100%; font-size: var(--fs-cap); }
  .dropdown-menu { position: static; display: none; min-width: 0; max-height: 260px; margin-top: 6px; box-shadow: none; border-color: var(--line-invert); background: rgba(255, 255, 255, .06); }
  .dropdown-menu a { color: var(--ink-invert-soft); }
  .dropdown-menu a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .nav-item.dropdown:hover .dropdown-menu { display: block; }

  .hero-inner { flex-direction: column; padding-top: 28px; padding-bottom: 20px; }
  .hero-copy { width: 100%; max-width: 100%; padding-left: 0; }
  .hero-media { position: relative; inset: auto; width: 100%; height: 240px; margin-top: 18px; }
  .hero { display: flex; flex-direction: column-reverse; }
  .hero-inner { order: 2; }
  .hero-media { order: 1; }
  .hero h1 { font-size: 30px; }

  .cat-grid, .species-grid { grid-template-columns: repeat(3, 1fr); }
  .step-grid, .season-grid { grid-template-columns: repeat(2, 1fr); }
  .habitat-grid { grid-template-columns: repeat(3, 1fr); }
  .scope-panel { grid-template-columns: 1fr; gap: 10px; }
  .cta-panel { grid-template-columns: 1fr; }
  .cta-media { height: 180px; }
}

@media (max-width: 680px) {
  :root { --gutter: 18px; }
  .header-inner { padding-top: 10px; padding-bottom: 8px; }
  .brand-name { font-size: 14px; }
  .site-nav { gap: 4px 14px; }
  .hero h1 { font-size: 26px; }
  .hero-lead { font-size: 13px; }
  .hero-stats { flex-wrap: wrap; }
  .cat-grid, .species-grid, .habitat-grid { grid-template-columns: repeat(2, 1fr); }
  .step-grid, .season-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 20px; }
  .cta-copy { padding: 16px 18px; }
  .footer-inner { flex-direction: column; gap: 18px; }
  .footer-brand, .footer-col, .footer-about { flex: 1 1 auto; width: 100%; }
  .footer-base { flex-direction: column; padding-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .cat-item:hover .cat-thumb img,
  .species-card:hover .species-thumb img { transform: none; }
}
