/* ================================================================
   我的昆虫博物馆 / My Insect Museum
   样式表：基于产品设计文档 §8「视觉与交互方向」
   - 白色基调、大留白、最大宽度 1080px
   - 中英并列常显：英文次级样式（字号小 1–2px、颜色较浅）
   - 不做复杂动效，最多 hover 微交互
   ================================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  /* 颜色 */
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1f1f1f;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --border: #ececec;
  --border-strong: #d9d9d9;

  /* 点缀色（苔绿，自然系） */
  --accent: #5a7a5a;
  --accent-soft: #8aa28a;
  --accent-bg: #f1f5f0;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, 0.08);

  /* 字体 */
  --font-sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif-en: 'EB Garamond', 'Cormorant Garamond', Georgia,
    'Times New Roman', serif;

  /* 字号 */
  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.8125rem;   /* 13 */
  --fs-base: 0.9375rem; /* 15 */
  --fs-md: 1rem;        /* 16 */
  --fs-lg: 1.125rem;    /* 18 */
  --fs-xl: 1.5rem;      /* 24 */
  --fs-2xl: 2rem;       /* 32 */
  --fs-3xl: 2.75rem;    /* 44 */
  --fs-4xl: 3.5rem;     /* 56 */

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;
  --sp-10: 128px;

  /* 容器 */
  --container: 1080px;
  --container-text: 720px;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 999px;

  /* 过渡 */
  --t-fast: 0.18s ease;
  --t-base: 0.22s ease;
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ---------- 中英并列长文：英文次级样式（§8.9）---------- */
.en {
  font-family: var(--font-sans);
  font-size: 0.92em;
  color: var(--text-secondary);
  line-height: 1.65;
  letter-spacing: 0.01em;
}

/* ---------- 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.container--narrow {
  max-width: var(--container-text);
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-brand__mark {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.site-brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-brand__name .en {
  font-size: 0.7em;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  /* 导航撑满头部整高，让激活指示线可以锚定头部底边，
     而不是依赖写死的像素偏移（头部高度变化时不会溢出） */
  align-self: stretch;
}

.site-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  /* 随导航（＝头部）高度自适应拉伸，文字垂直居中 */
  align-self: stretch;
  padding: 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color var(--t-fast);
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--text);
}

.site-nav__link.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  /* 贴在链接（＝头部）底边内侧，始终位于白色方框以内 */
  bottom: 0;
  height: 1px;
  background: var(--text);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
}

.lang-switch__btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background var(--t-fast), color var(--t-fast);
}

.lang-switch__btn.is-active {
  background: var(--text);
  color: var(--surface);
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: var(--sp-10);
  padding: var(--sp-9) 0 var(--sp-7);
  border-top: 1px solid var(--border);
}

.footer-quote {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-serif-en);
  font-size: var(--fs-lg);
  line-height: 1.7;
  color: var(--text-secondary);
  font-style: italic;
}

.footer-quote__zh {
  font-family: var(--font-sans);
  font-style: normal;
  color: var(--text);
}

.footer-quote__en {
  margin-top: var(--sp-4);
}

.footer-quote__en::before {
  content: '——';
  margin-right: var(--sp-2);
  color: var(--text-tertiary);
}

.footer-meta {
  margin-top: var(--sp-7);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.footer-meta__sep {
  color: var(--border-strong);
}

.footer-meta a {
  color: var(--text-tertiary);
  transition: color var(--t-fast);
}

.footer-meta a:hover {
  color: var(--text-secondary);
}

/* ---------- 备案信息（ICP 备案号 + 公安联网备案徽标） ---------- */

.footer-beian {
  margin-top: var(--sp-3);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  line-height: 1.6;
  color: var(--text-tertiary);
  text-align: center;
}

.footer-beian a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--t-fast);
}

.footer-beian a:hover {
  color: var(--text-secondary);
  text-decoration: underline;
}

.footer-beian__police {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.footer-beian__police img {
  width: 16px;
  height: 16px;
  display: block;
}

/* ================================================================
   首页（Home）
   ================================================================ */

.home {
  padding-top: var(--sp-8);
}

/* ---------- 个人名片（左右分栏） ---------- */
.profile-card {
  display: flex;
  max-width: 920px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* 左栏：头像 + 名字 + 简介 + 图标 */
.profile-card__left {
  flex: 0 0 42%;
  padding: var(--sp-7) var(--sp-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-right: 1px solid var(--border);
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 6px var(--accent-bg);
  margin-bottom: var(--sp-5);
}

.profile-avatar svg {
  width: 100%;
  height: 100%;
}

.profile-greeting {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.profile-name {
  margin: 0;
  font-size: var(--fs-2xl);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
}

.profile-name .en {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--font-serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 0.5em;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.profile-socials {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.social-btn {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: color var(--t-fast), background var(--t-fast),
    border-color var(--t-fast);
}

.social-btn:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-bg);
}

.social-btn svg {
  width: 18px;
  height: 18px;
}

.profile-bio {
  margin-top: var(--sp-6);
  font-size: var(--fs-sm);
  line-height: 1.75;
  color: var(--text-secondary);
}

.profile-bio .en {
  display: block;
  margin-top: var(--sp-3);
  font-size: 0.95em;
}

/* 右栏：图片轮播（可自定义，每张停留 3 秒） */
.profile-card__right {
  flex: 1;
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: var(--accent-bg);
}

.profile-photo {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.profile-photo.is-active {
  opacity: 1;
}

.profile-photo svg,
.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: background var(--t-base);
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--surface);
  transform: scale(1.2);
}

/* 栏目入口 */
.section-title {
  text-align: center;
  margin-bottom: var(--sp-7);
}

.section-title__zh {
  display: block;
  font-size: var(--fs-xl);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.section-title__en {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: var(--fs-base);
  color: var(--text-tertiary);
  letter-spacing: 0.05em;
}

.section-entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-9);
}

.entry-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--t-base), box-shadow var(--t-base),
    border-color var(--t-base);
  cursor: pointer;
}

.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.entry-card__img {
  aspect-ratio: 4 / 3;
  background: var(--accent-bg);
  overflow: hidden;
}

.entry-card__img svg {
  width: 100%;
  height: 100%;
}

.entry-card__body {
  padding: var(--sp-5);
}

.entry-card__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-lg);
  font-weight: 500;
}

.entry-card__title .en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 0.75em;
  color: var(--text-tertiary);
}

.entry-card__desc {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.entry-card__desc .en {
  display: block;
  margin-top: var(--sp-2);
  font-size: 0.95em;
}

.entry-card__cta {
  margin-top: var(--sp-4);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.entry-card__cta::after {
  content: '→';
  transition: transform var(--t-fast);
}

.entry-card:hover .entry-card__cta::after {
  transform: translateX(3px);
}

/* ================================================================
   栏目页（活动记录 / 饲养日志 / 标本图册）通用
   ================================================================ */

.page-header {
  padding: var(--sp-9) 0 var(--sp-7);
  text-align: center;
}

.page-header__title {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-3xl);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.page-header__title .en {
  display: block;
  margin-top: var(--sp-3);
  font-family: var(--font-serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 0.5em;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.page-header__intro {
  max-width: 640px;
  margin: var(--sp-6) auto 0;
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--text-secondary);
}

.page-header__intro .en {
  display: block;
  margin-top: var(--sp-3);
  font-size: 0.95em;
}

/* ================================================================
   时间轴（活动记录 / 饲养日志）
   ================================================================ */

.timeline {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: var(--sp-5) 0 var(--sp-9);
}

/* 中央对称时间线（活动记录） */
.timeline--center::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
  transform: translateX(-50%);
}

/* 左侧时间线 + 内容右置（饲养日志，错落感） */
.timeline--left::before {
  content: '';
  position: absolute;
  left: 88px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
}

.timeline__item {
  position: relative;
  margin-bottom: var(--sp-9);
}

/* 中央对称时间线的节点：左右交替 */
.timeline--center .timeline__item {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  gap: var(--sp-4);
}

.timeline--center .timeline__item:nth-child(odd) .timeline__card {
  grid-column: 1;
  text-align: right;
}

.timeline--center .timeline__item:nth-child(odd) .timeline__year {
  grid-column: 2;
}

.timeline--center .timeline__item:nth-child(odd) .timeline__spacer {
  grid-column: 3;
}

.timeline--center .timeline__item:nth-child(even) .timeline__spacer {
  grid-column: 1;
}

.timeline--center .timeline__item:nth-child(even) .timeline__year {
  grid-column: 2;
}

.timeline--center .timeline__item:nth-child(even) .timeline__card {
  grid-column: 3;
}

.timeline__year {
  font-family: var(--font-serif-en);
  font-size: var(--fs-2xl);
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.04em;
  text-align: center;
  position: relative;
}

.timeline__year::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* 左侧时间线的节点：年份左对齐 */
.timeline--left .timeline__item {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: start;
  gap: var(--sp-5);
}

.timeline--left .timeline__year {
  text-align: right;
  padding-top: var(--sp-5);
  font-size: var(--fs-xl);
}

.timeline--left .timeline__year::before {
  left: 88px;
  top: calc(var(--sp-5) + 14px);
}

.timeline--left .timeline__species {
  display: block;
  margin-top: var(--sp-2);
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.02em;
  text-align: right;
  padding-right: 2px;
}

.timeline--left .timeline__species .en {
  display: block;
  font-size: 0.85em;
  color: var(--accent-soft);
  margin-top: 2px;
}

/* 卡片 */
.timeline__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t-base), box-shadow var(--t-base),
    border-color var(--t-base);
  position: relative;
}

.timeline__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.timeline__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--accent-bg);
}

.timeline__cover svg {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

.timeline__card:hover .timeline__cover svg {
  transform: scale(1.04);
}

.timeline__cover-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(31, 31, 31, 0.0);
  color: var(--surface);
  font-size: var(--fs-sm);
  letter-spacing: 0.05em;
  opacity: 0;
  transition: background var(--t-base), opacity var(--t-base);
}

.timeline__cover-hint span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(31, 31, 31, 0.55);
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
  font-size: var(--fs-xs);
}

.timeline__card:hover .timeline__cover-hint {
  background: rgba(31, 31, 31, 0.12);
  opacity: 1;
}

.timeline__meta {
  padding: var(--sp-4) var(--sp-5);
}

.timeline__meta-title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.5;
}

.timeline__meta-title .en {
  display: block;
  margin-top: 4px;
  font-size: 0.88em;
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--text-tertiary);
}

.timeline__center-line {
  display: none;
}

/* ================================================================
   活动详情页 / 照片墙
   ================================================================ */

.detail-page {
  padding-top: var(--sp-7);
}

/* 返回列表按钮 */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: color var(--t-fast), background var(--t-fast),
    border-color var(--t-fast);
}

.back-btn:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-bg);
}

.back-btn svg {
  width: 16px;
  height: 16px;
  transition: transform var(--t-fast);
}

.back-btn:hover svg {
  transform: translateX(-2px);
}

.detail-header {
  margin: var(--sp-6) 0 var(--sp-8);
}

.detail-year {
  font-family: var(--font-serif-en);
  font-size: var(--fs-xl);
  color: var(--accent);
  letter-spacing: 0.08em;
}

.detail-title {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-3xl);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.detail-title .en {
  display: block;
  margin-top: var(--sp-3);
  font-family: var(--font-serif-en);
  font-style: italic;
  font-weight: 400;
  font-size: 0.5em;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}

/* 照片墙：瀑布流，竖版(3:4)与横版(4:3)自然错落 */
.photo-wall {
  columns: 3;
  column-gap: var(--sp-5);
}

.photo-item {
  break-inside: avoid;
  margin: 0 0 var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.photo-item__frame {
  background: var(--accent-bg);
}

.photo-item__frame svg,
.photo-item__frame img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-item__caption {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--text);
}

.photo-item__caption .en {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------------
   详情页正文两栏：左照片墙 / 右公众号推文栏
   - 无推文时不加 has-aside，退回单栏（照片墙仍是 3 列）
   - 有推文时照片墙收成 2 列，给右栏留位置
   ------------------------------------------------------------------ */
.detail-body.has-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--sp-6);
  align-items: start;
}

.detail-body.has-aside .photo-wall {
  columns: 2;
}

.detail-aside {
  position: sticky;
  top: calc(var(--sp-6) + 56px);
}

/* 公众号推文卡 */
.article-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease,
    border-color 0.25s ease;
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}

.article-card__thumb {
  position: relative;
  background: var(--accent-bg);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.article-card__thumb img,
.article-card__thumb svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-card__tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-4) var(--sp-4) 0;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  color: var(--accent);
}

.article-card__tag::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.85;
  flex: none;
}

.article-card__title {
  padding: var(--sp-2) var(--sp-4) 0;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}

.article-card__cta {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.article-card:hover .article-card__cta {
  color: var(--accent);
}

/* 照片网格（标本详情页：统一 4:3 等宽，无主次） */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-9);
}

.photo-grid .photo-item__frame {
  aspect-ratio: 4 / 3;
}

.photo-grid .photo-item__frame img {
  height: 100%;
  object-fit: cover;
}

/* 后台媒体（真实图片）填充样式 */
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.timeline__card:hover .timeline__cover img {
  transform: scale(1.04);
}

.specimen-masonry__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.specimen-masonry__item:hover .specimen-masonry__media img {
  transform: scale(1.05);
}

/* ================================================================
   标本图册（列表页：置顶 + 纯图片网格）
   ================================================================ */

/* 标本图册：瀑布流卡片（图片在上、文字在下；竖版 3:4 与横版 4:3 混排） */
.specimen-masonry {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  margin-bottom: var(--sp-9);
}

.specimen-masonry__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.specimen-masonry__item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}

.specimen-masonry__item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.specimen-masonry__media {
  background: var(--accent-bg);
  overflow: hidden;
}

.specimen-masonry__media.is-landscape {
  aspect-ratio: 4 / 3;
}

.specimen-masonry__media.is-portrait {
  aspect-ratio: 3 / 4;
}

.specimen-masonry__media svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.35s ease;
}

.specimen-masonry__item:hover .specimen-masonry__media svg {
  transform: scale(1.04);
}

.specimen-masonry__caption {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

.specimen-masonry__title {
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.specimen-masonry__sub {
  margin-top: 2px;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
}

.specimen-masonry__meta {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

/* ================================================================
   标本工具栏：模糊搜索 + 排序
   ================================================================ */

.specimen-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.specimen-search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.specimen-search__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.specimen-search__input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 38px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.specimen-search__input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.specimen-search__input::placeholder {
  color: var(--text-tertiary);
}

.specimen-search__clear {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.specimen-search__clear:hover {
  background: var(--accent-bg);
  color: var(--text);
}

.specimen-sort {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.specimen-sort__btn {
  padding: 5px 14px;
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast);
}

.specimen-sort__btn:hover {
  color: var(--text);
}

.specimen-sort__btn.is-active {
  color: var(--surface);
  background: var(--accent);
}

.specimen-empty {
  padding: var(--sp-8) 0;
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  letter-spacing: 0.02em;
}

/* ================================================================
   标本详情页：多图 + 多视频
   ================================================================ */

.detail-desc {
  max-width: 640px;
  margin: var(--sp-5) 0 0;
  font-size: var(--fs-base);
  line-height: 1.85;
  color: var(--text-secondary);
}

.detail-desc .en {
  display: block;
  margin-top: var(--sp-3);
  font-size: 0.95em;
}

/* 虫种标签（饲养日志详情页顶部） */
.detail-species {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--accent-bg);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--accent);
  letter-spacing: 0.02em;
}

.detail-species .en {
  font-size: 0.88em;
  color: var(--accent-soft);
  margin-top: 2px;
}

.section-label {
  margin: var(--sp-8) 0 var(--sp-4);
  font-size: var(--fs-lg);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.section-label .en {
  display: block;
  margin-top: 2px;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 0.7em;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}

/* 视频网格：点击封面直接播放 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-9);
}

.video-item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.video-item__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111;
  cursor: pointer;
  overflow: hidden;
}

.video-item__frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.video-item__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  transition: transform var(--t-base);
}

.video-item__play svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.video-item__frame:hover .video-item__play {
  transform: scale(1.1);
}

.video-item__video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.video-item__caption {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text);
}

.video-item__caption .en {
  display: block;
  margin-top: 4px;
  font-size: 0.9em;
  color: var(--text-secondary);
}

/* ================================================================
   饲养日志：暖色系差异化（赭黄/琥珀，区别于活动记录的苔绿）
   ================================================================ */

body[data-page='rearing'],
body[data-page='rearing-detail'] {
  --accent: #a9783c;
  --accent-soft: #c79a5f;
  --accent-bg: #f8f2e8;
}

/* ================================================================
   响应式
   ================================================================ */

@media (max-width: 900px) {
  .section-entries {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  /* 照片墙：平板 2 列 */
  .photo-wall {
    columns: 2;
  }

  /* 详情页两栏：平板起改为上下堆叠，推文卡移到照片墙下方 */
  .detail-body.has-aside {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }

  .detail-aside {
    position: static;
  }

  /* 视频网格：平板 2 列 */
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 时间轴在窄屏堆叠单列 */
  .timeline--center::before {
    left: 24px;
  }

  .timeline--center .timeline__item,
  .timeline--left .timeline__item {
    grid-template-columns: 60px 1fr;
    gap: var(--sp-3);
  }

  .timeline--center .timeline__item:nth-child(odd) .timeline__card,
  .timeline--center .timeline__item:nth-child(even) .timeline__card,
  .timeline--center .timeline__item:nth-child(odd) .timeline__spacer,
  .timeline--center .timeline__item:nth-child(even) .timeline__spacer,
  .timeline--center .timeline__item:nth-child(odd) .timeline__year,
  .timeline--center .timeline__item:nth-child(even) .timeline__year {
    grid-column: auto;
    text-align: left;
  }

  .timeline--center .timeline__year,
  .timeline--left .timeline__year {
    text-align: left;
    padding-top: var(--sp-4);
  }

  .timeline--center .timeline__year::before {
    left: 24px;
    top: calc(var(--sp-4) + 8px);
    transform: translate(-50%, 0);
  }

  .timeline--left::before {
    left: 24px;
  }

  .timeline--left .timeline__year::before {
    left: 24px;
    top: calc(var(--sp-4) + 8px);
    transform: translate(-50%, 0);
  }

  .timeline--left .timeline__species {
    text-align: left;
    padding-right: 0;
  }
}

/* 名片在窄屏上下堆叠 */
@media (max-width: 760px) {
  .profile-card {
    flex-direction: column;
  }

  .profile-card__left {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--sp-6) var(--sp-5);
  }

  .profile-card__right {
    min-height: 300px;
  }
}

@media (max-width: 640px) {
  :root {
    --fs-3xl: 2.25rem;
    --fs-2xl: 1.625rem;
    --fs-xl: 1.25rem;
  }

  .home {
    padding-top: var(--sp-7);
  }

  /* 顶部导航：窄屏改为上下两行（品牌一行 / 导航一行）
     原本品牌与 4 个导航项 + 语言切换挤在同一行，长站名会被压得逐字折行并与导航重叠 */
  .site-header__inner {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--sp-2);
    padding: var(--sp-3) 0;
  }

  .site-brand {
    justify-content: center;
    font-size: var(--fs-base);
  }

  /* 站名（中/英）各自不折行 */
  .site-brand__name {
    white-space: nowrap;
  }

  .site-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-4);
  }

  .site-nav__link {
    /* 窄屏导航为多行排列，不做高度拉伸，指示线紧贴文字 */
    align-self: center;
    padding: var(--sp-1) 0;
    font-size: var(--fs-xs);
  }

  /* 激活下划线紧贴文字，始终在头部方框内部 */
  .site-nav__link.is-active::after {
    bottom: 0;
  }

  .profile-card__right {
    min-height: 240px;
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
    box-shadow: 0 0 0 5px var(--accent-bg);
  }

  /* 照片墙：手机单列 */
  .photo-wall,
  .detail-body.has-aside .photo-wall {
    columns: 1;
  }

  /* 照片网格：手机单列 */
  .photo-grid {
    grid-template-columns: 1fr;
  }

  /* 瀑布流：手机收紧间距 */
  .specimen-masonry {
    gap: var(--sp-3);
  }

  .specimen-masonry__col {
    gap: var(--sp-3);
  }

  /* 视频网格：手机单列 */
  .video-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    padding: var(--sp-7) 0 var(--sp-5);
  }

  .footer-quote {
    font-size: var(--fs-base);
    padding: 0 var(--sp-3);
  }
}

/* ---------- 焦点可见性（无障碍 NF6）---------- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- 隐藏但可被 JS 注入 i18n 文案的占位 ---------- */
[data-i18n]:empty::before {
  content: attr(data-i18n-placeholder);
  color: var(--text-tertiary);
}

/* ---------- 无障碍：视觉隐藏但保留给屏幕阅读器 ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}