/*
 * style.css — 「鱼鱼来了」全站样式
 * 设计基调：纸刊感、极简、细线分隔、系统字体、轻量动效。
 * 结构：基础变量 / 站点框架 / 首页 / 文章页 / 游戏页 / 环境互动 / 响应式与降级。
 */

/* ===== 01. 基础变量与重置 ===== */
:root {
  --color-bg: #FAFAF7;
  --color-text: #0E1116;
  --color-muted: #6B7280;
  --color-line: #E5E5E0;
  --color-accent: #2B6E8F;
  --color-number: #E8734A;
  --color-wash: #F1F1EC;

  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --gutter: clamp(24px, 5vw, 48px);
  --wide: 1100px;
  --prose: 680px;
  --space-section: clamp(96px, 12vw, 144px);
  --space-block: clamp(48px, 7vw, 80px);

  --radius: 3px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --duration: 320ms;
}

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

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
textarea,
select {
  font-family: var(--font-sans);
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

button {
  color: inherit;
  font: inherit;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--color-accent);
  color: #FFFFFF;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 1px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 13px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 220ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* ===== 02. 站点页头 ===== */
.site-header {
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  min-height: 72px;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  transition: color 220ms var(--ease);
}

.brand:hover {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 34px);
}

.nav-link {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-muted);
  font-size: 14px;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: color 220ms var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 9px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration) var(--ease);
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--color-text);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ===== 03. 首页 Hero ===== */
.hero {
  position: relative;
  display: flex;
  min-height: clamp(580px, calc(100svh - 72px), 860px);
  padding-block: clamp(88px, 13vh, 150px);
  overflow: hidden;
  align-items: center;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero-copy {
  max-width: 760px;
}

.hero-copy > * {
  animation: intro-rise 380ms var(--ease) both;
}

.hero-copy > :nth-child(2) {
  animation-delay: 80ms;
}

.hero-copy > :nth-child(3) {
  animation-delay: 150ms;
}

.hero-copy > :nth-child(4) {
  animation-delay: 210ms;
}

@keyframes intro-rise {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: 0.015em;
  line-height: 1.18;
}

.hero-subtitle {
  max-width: 29em;
  margin-top: clamp(28px, 4vw, 40px);
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-hint {
  display: inline-flex;
  margin-top: clamp(56px, 9vh, 96px);
  align-items: center;
  gap: 10px;
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.hero-hint::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border: 1px solid var(--color-accent);
  border-radius: 50%;
}

.hero-fish-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-fish {
  position: absolute;
  top: 58%;
  left: 66%;
  width: clamp(180px, 26vw, 310px);
  height: auto;
  color: var(--color-accent);
  opacity: 0.2;
  transform: translate(-50%, -50%);
  transform-origin: center;
  will-change: transform;
}

.hero-fish path,
.hero-fish circle {
  vector-effect: non-scaling-stroke;
}

/* ===== 04. 首页内容区与文章列表 ===== */
.section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--color-line);
}

.section-head {
  display: flex;
  margin-bottom: clamp(40px, 6vw, 64px);
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.section-title {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3.2vw, 34px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.section-note {
  max-width: 30em;
  padding-bottom: 6px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.8;
}

.post-list {
  border-top: 1px solid var(--color-line);
  list-style: none;
}

.post-item {
  border-bottom: 1px solid var(--color-line);
}

.post-link {
  display: grid;
  padding-block: clamp(30px, 4.4vw, 44px);
  grid-template-columns: 118px minmax(0, 1fr) 26px;
  gap: clamp(20px, 4vw, 52px);
  align-items: start;
  text-decoration: none;
}

.post-meta {
  display: flex;
  padding-top: 7px;
  flex-direction: column;
  gap: 7px;
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.post-index {
  color: var(--color-accent);
  letter-spacing: 0.12em;
}

.post-date {
  color: var(--color-muted);
}

.post-reading {
  color: var(--color-muted);
}

.post-title {
  position: relative;
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.5vw, 29px);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.45;
  transition: color 220ms var(--ease);
}

.post-title::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -6px;
  left: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration) var(--ease);
}

.post-link:hover .post-title,
.post-link:focus-visible .post-title {
  color: var(--color-accent);
}

.post-link:hover .post-title::after,
.post-link:focus-visible .post-title::after {
  transform: scaleX(1);
}

.post-summary {
  max-width: 42em;
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.8;
}

.post-arrow {
  padding-top: 8px;
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.5;
  transition: color 220ms var(--ease), transform var(--duration) var(--ease);
}

.post-link:hover .post-arrow,
.post-link:focus-visible .post-arrow {
  color: var(--color-accent);
  transform: translateX(4px);
}

.empty-posts {
  padding: 32px 0;
  color: var(--color-muted);
  font-size: 14px;
}

/* ===== 05. 关于 ===== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: start;
}

.about-title {
  max-width: 14em;
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: clamp(25px, 3.2vw, 36px);
  font-weight: 600;
  line-height: 1.55;
}

.about-copy {
  max-width: 34em;
}

.about-copy p {
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.85;
}

.about-copy p + p {
  margin-top: 18px;
}

.about-numbers {
  display: grid;
  margin-top: clamp(36px, 5vw, 52px);
  padding-top: 26px;
  border-top: 1px solid var(--color-line);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.about-numbers dt {
  color: var(--color-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.about-numbers dd {
  margin-top: 4px;
  color: var(--color-number);
  font-family: var(--font-serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.about-numbers .unit {
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ===== 06. 页脚与鱼群 ===== */
.site-footer {
  padding: clamp(64px, 9vw, 92px) 0 32px;
  border-top: 1px solid var(--color-line);
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
}

.footer-note {
  max-width: 24em;
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding-top: 4px;
}

.footer-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 220ms var(--ease);
}

.footer-link:hover {
  color: var(--color-accent);
}

.footer-link .external {
  font-size: 11px;
}

.footer-fish-band {
  position: relative;
  height: 58px;
  margin: clamp(44px, 7vw, 68px) 0 26px;
  overflow: hidden;
}

.fish-track {
  display: flex;
  width: max-content;
  animation: fish-school-drift 42s linear infinite;
  will-change: transform;
}

.fish-school {
  display: flex;
  height: 58px;
  padding-right: 54px;
  align-items: center;
  gap: 54px;
}

.school-fish {
  width: 34px;
  height: auto;
  flex: 0 0 auto;
  color: var(--color-accent);
  opacity: 0.3;
}

.school-fish:nth-child(2n) {
  width: 26px;
  opacity: 0.22;
  transform: translateY(-13px);
}

.school-fish:nth-child(3n) {
  width: 40px;
  opacity: 0.25;
  transform: translateY(9px);
}

.school-fish:nth-child(5n) {
  width: 20px;
  opacity: 0.36;
  transform: translateY(4px);
}

@keyframes fish-school-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .footer-fish-band:hover .fish-track {
    animation-play-state: paused;
  }
}

.footer-bottom {
  display: flex;
  padding-top: 18px;
  border-top: 1px solid var(--color-line);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--color-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

.footer-bottom p {
  margin: 0;
}

/* ===== 07. 文章页 ===== */
.article-main {
  padding-bottom: var(--space-section);
}

.article {
  width: 100%;
  max-width: calc(var(--prose) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.back-link {
  display: inline-flex;
  margin: clamp(40px, 7vw, 64px) 0 clamp(56px, 8vw, 84px);
  align-items: center;
  gap: 9px;
  color: var(--color-muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 220ms var(--ease);
}

.back-link .arrow {
  transition: transform var(--duration) var(--ease);
}

.back-link:hover {
  color: var(--color-accent);
}

.back-link:hover .arrow {
  transform: translateX(-4px);
}

.article-header {
  margin-bottom: clamp(48px, 7vw, 64px);
}

.article-kicker {
  display: flex;
  color: var(--color-accent);
  font-size: 12px;
  letter-spacing: 0.1em;
  line-height: 1.7;
  align-items: center;
  gap: 10px;
}

.article-kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--color-accent);
}

.article-title {
  margin-top: 20px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--color-line);
  gap: 8px 20px;
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.article-meta span + span::before {
  content: "";
  width: 1px;
  height: 10px;
  background: var(--color-line);
}

.article-body {
  font-size: 17px;
  line-height: 1.75;
}

.article-body > p {
  margin-bottom: 1.55em;
}

.article-body > p:first-child {
  color: var(--color-text);
}

.article-body h2 {
  margin: 2.5em 0 0.85em;
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.article-body h3 {
  margin: 2em 0 0.7em;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
}

.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent) 35%, transparent);
  transition: text-decoration-color 220ms var(--ease);
}

.article-body a:hover {
  text-decoration-color: var(--color-accent);
}

.article-body strong {
  font-weight: 600;
}

.article-body ul,
.article-body ol {
  margin: 1.3em 0 1.8em;
  padding-left: 1.35em;
}

.article-body li {
  margin-bottom: 0.55em;
  padding-left: 0.2em;
}

.article-body li::marker {
  color: var(--color-accent);
}

.article-body blockquote {
  margin: clamp(32px, 5vw, 48px) 0;
  padding: 4px 0 4px clamp(20px, 4vw, 30px);
  border-left: 2px solid var(--color-accent);
  font-family: var(--font-serif);
  font-size: clamp(19px, 2.4vw, 22px);
  line-height: 1.8;
}

.article-body blockquote p {
  margin: 0;
}

.article-body blockquote cite {
  display: block;
  margin-top: 12px;
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.04em;
}

.article-body figure {
  margin: clamp(36px, 5vw, 52px) 0;
}

.article-body figure img {
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-wash);
}

.article-body figcaption {
  margin-top: 12px;
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.75;
}

.article-body code {
  padding: 0.14em 0.38em;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  background: var(--color-wash);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.article-body pre {
  margin: clamp(30px, 4vw, 40px) 0;
  padding: clamp(20px, 4vw, 28px);
  border-radius: var(--radius);
  overflow-x: auto;
  background: var(--color-text);
  color: #F7F7F2;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  tab-size: 2;
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.article-body hr {
  width: 56px;
  margin: 3em 0;
  border: 0;
  border-top: 1px solid var(--color-line);
}

.article-body .book-list {
  margin: 1.4em 0 2em;
  padding-left: 1.3em;
}

.article-body .book-list > li {
  margin-bottom: 1.25em;
}

.article-foot {
  margin-top: clamp(64px, 9vw, 88px);
  padding-top: 28px;
  border-top: 1px solid var(--color-line);
}

.article-end {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-accent);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.article-end svg {
  width: 34px;
  height: auto;
  opacity: 0.65;
}

.article-foot-note {
  margin-top: 20px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.8;
}

.post-nav {
  display: grid;
  margin-top: clamp(56px, 8vw, 72px);
  padding-top: 26px;
  border-top: 1px solid var(--color-line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.post-nav-link {
  display: block;
  text-decoration: none;
}

.post-nav-link:last-child {
  text-align: right;
}

.post-nav-label {
  color: var(--color-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.post-nav-title {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  transition: color 220ms var(--ease);
}

.post-nav-link:hover .post-nav-title {
  color: var(--color-accent);
}

.article-status {
  padding: 32px 0;
  color: var(--color-muted);
  font-size: 14px;
}

.article-missing {
  padding: 48px 0;
}

.article-missing p {
  color: var(--color-muted);
  font-size: 16px;
}

.article-missing .article-title {
  color: var(--color-text);
}

.article-missing a {
  display: inline-block;
  margin-top: 24px;
  color: var(--color-accent);
}

/* ===== 08. 游戏页 ===== */
.play-main {
  padding-top: clamp(56px, 8vw, 88px);
  padding-bottom: var(--space-section);
  padding-inline: var(--gutter);
}

.play-head {
  max-width: 720px;
  margin: 0 auto clamp(36px, 5vw, 52px);
}

.play-title {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.play-intro {
  max-width: 36em;
  margin-top: 20px;
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.8;
}

.game-panel {
  max-width: 720px;
  margin-inline: auto;
}

.game-topbar {
  display: flex;
  margin-bottom: 22px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.game-stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(22px, 4vw, 40px);
}

.stat {
  min-width: 48px;
}

.stat-label {
  display: block;
  color: var(--color-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.7;
}

.stat-value {
  display: flex;
  min-height: 34px;
  align-items: baseline;
  gap: 4px;
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat-value.is-score,
.stat-value.is-best {
  color: var(--color-number);
}

.stat-value.is-low {
  color: var(--color-number);
}

.stat-unit {
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.lives {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
}

.life-icon {
  width: 18px;
  height: auto;
  color: var(--color-accent);
  opacity: 0.9;
  transition: opacity 220ms var(--ease);
}

.life-icon.is-lost {
  opacity: 0.18;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 17px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  cursor: pointer;
  transition:
    color 220ms var(--ease),
    border-color 220ms var(--ease),
    background-color 220ms var(--ease);
}

.btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-primary {
  border-color: var(--color-text);
  background: var(--color-text);
  color: var(--color-bg);
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #FFFFFF;
}

.btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.canvas-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  aspect-ratio: 3 / 2;
  background: var(--color-bg);
  touch-action: none;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

#game-canvas:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -4px;
}

.game-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  padding: 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(250, 250, 247, 0.94);
  text-align: center;
}

.overlay-kicker {
  color: var(--color-accent);
  font-size: 10px;
  letter-spacing: 0.16em;
  line-height: 1.7;
}

.overlay-title {
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 600;
  line-height: 1.4;
}

.overlay-text {
  max-width: 30em;
  margin-top: 10px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.8;
}

.overlay-result {
  display: flex;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.7;
}

.overlay-result strong {
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.overlay-result .best-number {
  color: var(--color-number);
}

.overlay-action {
  margin-top: 22px;
}

.game-note {
  margin-top: 16px;
  color: var(--color-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.8;
}

.game-note kbd {
  padding: 2px 5px;
  border: 1px solid var(--color-line);
  border-radius: 2px;
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* ===== 09. 全站环境互动 ===== */
.ambient-layer {
  position: fixed;
  z-index: 20;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cursor-bubble {
  position: absolute;
  width: var(--bubble-size, 7px);
  height: var(--bubble-size, 7px);
  border: 1px solid rgba(43, 110, 143, 0.42);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: bubble-drift 2s var(--ease) forwards;
  will-change: transform, opacity;
}

@keyframes bubble-drift {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.55);
  }
  18% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--bubble-drift, 5px)), calc(-50% - 58px)) scale(1.08);
  }
}

.ambient-fish {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-accent);
  pointer-events: none;
  will-change: transform, opacity;
}

.ambient-fish svg {
  display: block;
  width: 100%;
  height: auto;
}

.feed-fish {
  width: 34px;
  opacity: 0;
}

.bait {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-accent);
  will-change: transform, opacity;
}

.bait:nth-child(3n) {
  background: var(--color-number);
}

.crossing-fish {
  width: clamp(42px, 6vw, 68px);
  opacity: 0;
}

/* ===== 10. 响应式 ===== */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-copy {
    max-width: 42em;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .section-note {
    max-width: 38em;
    padding-bottom: 0;
  }

  .hero-fish {
    left: 73%;
    width: clamp(160px, 32vw, 250px);
    opacity: 0.17;
  }
}

@media (max-width: 700px) {
  .post-link {
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 10px 16px;
  }

  .post-meta {
    grid-column: 1 / -1;
    padding-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }

  .post-meta > * + *::before {
    content: "";
    display: inline-block;
    width: 1px;
    height: 9px;
    margin-right: 14px;
    background: var(--color-line);
    vertical-align: middle;
  }

  .post-summary {
    margin-top: 9px;
  }

  .post-arrow {
    padding-top: 2px;
  }

  .game-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

  .game-actions {
    width: 100%;
  }

  .game-actions .btn {
    flex: 1 1 auto;
  }

  .footer-top {
    flex-direction: column;
    gap: 24px;
  }

  .footer-links {
    padding-top: 0;
  }

  .post-nav {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .post-nav-link:last-child {
    padding-top: 20px;
    border-top: 1px solid var(--color-line);
    text-align: left;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .header-inner {
    min-height: 64px;
  }

  .brand {
    font-size: 15px;
  }

  .site-nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 13px;
  }

  .nav-link::after {
    bottom: 8px;
  }

  .hero {
    min-height: clamp(520px, calc(100svh - 64px), 680px);
    padding-block: 88px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-hint {
    margin-top: 56px;
    font-size: 11px;
  }

  .hero-fish {
    top: 64%;
    left: 72%;
    width: 158px;
    opacity: 0.14;
  }

  .post-title {
    font-size: 22px;
  }

  .post-summary {
    font-size: 14px;
  }

  .post-arrow {
    font-size: 14px;
  }

  .about-numbers {
    gap: 14px;
  }

  .about-numbers dd {
    font-size: 26px;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .article-body {
    font-size: 16px;
  }

  .article-body pre {
    font-size: 12px;
  }

  .article-meta {
    gap: 6px 14px;
  }

  .article-meta span {
    gap: 14px;
  }

  .article-meta span + span::before {
    display: none;
  }

  .play-intro {
    font-size: 14px;
  }

  .game-note {
    font-size: 11px;
  }

  .game-overlay {
    padding: 16px;
  }

  .overlay-text {
    display: none;
  }

  .overlay-result {
    margin-top: 10px;
    gap: 4px 18px;
  }

  .overlay-action {
    margin-top: 14px;
  }
}

@media (max-width: 380px) {
  .site-nav {
    gap: 12px;
  }

  .nav-link {
    font-size: 12px;
  }

  .brand {
    letter-spacing: 0.08em;
  }

  .hero-title {
    font-size: 32px;
  }

  .post-meta {
    font-size: 11px;
  }

  .game-actions .btn {
    padding-inline: 10px;
    font-size: 11px;
  }
}

/* ===== 11. 减少动态效果 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .hero-copy > * {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .fish-track {
    animation: none !important;
    transform: none !important;
  }

  .cursor-bubble,
  .ambient-fish,
  .bait {
    display: none !important;
  }

  .hero-fish {
    will-change: auto;
  }
}

/* ===== 12. 打印 ===== */
@media print {
  .site-header,
  .site-footer,
  .back-link,
  .post-nav,
  .ambient-layer,
  .hero-fish-layer {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
    font-size: 12pt;
  }

  .article {
    max-width: none;
    padding: 0;
  }

  .article-title {
    font-size: 26pt;
  }

  .article-body pre {
    border: 1px solid #CCCCCC;
    background: #FFFFFF;
    color: #000000;
  }

  .article-body a {
    color: #000000;
  }
}
