:root {
  --ink: #25343b;
  --muted: #66787e;
  --mist: #edf3f3;
  --paper: #f8fbfa;
  --line: rgba(37, 52, 59, .15);
  --blue: #7199a2;
  --sage: #a8beb4;
  --moon: #dfeceb;
  --shadow: 0 22px 50px rgba(42, 61, 67, .12);
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--mist);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--mist);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .26;
  background-image: url("./assets/noise.svg");
  background-repeat: repeat;
}

button,
a { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
}

a { color: inherit; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 12px;
  background: var(--mist);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  text-align: center;
  transition: opacity .35s ease, visibility .35s ease;
}

.loading img {
  width: 74px;
  height: 74px;
  margin: 0 auto;
  border-radius: 50%;
  box-shadow: var(--shadow);
}

.loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.page-shell {
  width: min(100%, 760px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  text-decoration: none;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(113, 153, 162, .14);
}

.mist-button,
.secondary-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .38);
  color: var(--muted);
  cursor: pointer;
}

.mist-button {
  min-width: 50px;
  padding: 0 8px;
  font-size: 11px;
}

.hero {
  display: grid;
  min-height: calc(100svh - 52px);
  align-items: center;
  gap: 24px;
  padding: 32px 0 44px;
  animation: fade-up .75s ease both;
}

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

.eyebrow,
.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .15em;
  line-height: 1.6;
}

.hero h1 {
  margin: 13px 0 17px;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 39px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
}

.hero-lead {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 17px;
  line-height: 2;
}

.hero-signature {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 14px;
  max-width: 540px;
  margin-top: 21px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.hero-cat-wrap {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 294px;
}

.hero-cat {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(68vw, 270px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 8px;
  background: rgba(255, 255, 255, .34);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: manipulation;
  transition: box-shadow .2s ease, background .2s ease;
}

.hero-cat:focus-visible,
.choice:focus-visible,
.primary-link:focus-visible,
.secondary-button:focus-visible,
.mist-button:focus-visible {
  outline: 3px solid rgba(113, 153, 162, .42);
  outline-offset: 3px;
}

.hero-cat:hover {
  background: rgba(255, 255, 255, .52);
  box-shadow: 0 26px 56px rgba(42, 61, 67, .15);
}

.hero-cat img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  object-fit: cover;
}

.hero-cat span:last-child {
  display: block;
  padding-top: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: .1em;
}

.cat-halo {
  position: absolute;
  top: 12px;
  right: 8%;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(113, 153, 162, .34);
  border-radius: 50%;
  background: var(--moon);
  transform: translate(15px, -20px);
}

.cat-halo::after {
  position: absolute;
  top: -3px;
  right: -7px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--mist);
  content: "";
}

.hero-cat-reply {
  width: min(100%, 310px);
  min-height: 42px;
  margin: 14px 0 0;
  color: var(--blue);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.hero-cat-reply.is-revealed { animation: reply-in .48s cubic-bezier(.18, .82, .27, 1) both; }

.hero-cat.is-dodge-right { animation: dodge-right .82s cubic-bezier(.16, .84, .3, 1) both; }
.hero-cat.is-dodge-left { animation: dodge-left .82s cubic-bezier(.16, .84, .3, 1) both; }
.hero-cat.is-hug { animation: cat-hug .92s cubic-bezier(.18, .78, .28, 1) both; }
.hero-cat.is-peek { animation: cat-peek .9s cubic-bezier(.16, .84, .3, 1) both; }
.hero-cat.is-settle { animation: cat-settle .9s cubic-bezier(.18, .78, .28, 1) both; }
.hero-cat.is-turn { animation: cat-turn .9s cubic-bezier(.16, .84, .3, 1) both; }

.read-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: fit-content;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: #f6fbfb;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: .06em;
}

.read-button span:last-child {
  color: var(--sage);
  font-size: 18px;
  line-height: 1;
}

.read-button:active,
.secondary-button:active,
.choice:active,
.primary-link:active {
  transform: translateY(2px) scale(.99);
}

.story-intro {
  display: grid;
  gap: 12px;
  margin: 0 0 56px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.story-intro p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 16px;
  line-height: 2;
}

.story { position: relative; }

.progress-line {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 4;
  width: 100%;
  height: 2px;
  margin: 0 0 42px;
  background: rgba(37, 52, 59, .11);
}

.progress-line span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--blue);
  transition: width .25s ease;
}

.story-beat {
  position: relative;
  display: grid;
  gap: 18px;
  margin: 0 0 72px;
  padding-left: 24px;
  scroll-margin-top: 38px;
  animation: fade-up .7s ease both;
}

.story-beat::before {
  position: absolute;
  top: 6px;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: var(--line);
  content: "";
}

.story-beat::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 9px;
  height: 9px;
  border: 2px solid var(--blue);
  border-radius: 50%;
  background: var(--mist);
  content: "";
}

.beat-head {
  display: grid;
  gap: 7px;
}

.beat-date {
  margin: 0;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.beat-title {
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 27px;
  font-weight: 400;
  line-height: 1.45;
}

.beat-state {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.beat-body {
  display: grid;
  gap: 13px;
}

.beat-body p {
  margin: 0;
  color: #52656b;
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 16px;
  line-height: 2.03;
}

.beat-body p:first-child::first-letter {
  color: var(--ink);
  font-size: 2.3em;
  line-height: .8;
}

.beat-scene {
  display: grid;
  grid-template-columns: minmax(100px, 138px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 12px 0 4px;
}

.beat-cat {
  width: 100%;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 7px;
  background: rgba(255, 255, 255, .4);
  box-shadow: 0 12px 26px rgba(42, 61, 67, .09);
}

.beat-cat img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
}

.beat-cat-caption {
  margin: 8px 2px 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.beat-aside {
  margin: 0;
  color: var(--blue);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.9;
}

.interaction-box {
  display: grid;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.interaction-title {
  margin: 0;
  color: var(--muted);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 14px;
  line-height: 1.8;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  min-height: 86px;
  padding: 5px 4px 7px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 6px;
  background: rgba(255, 255, 255, .4);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(42, 61, 67, .06);
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.choice:hover {
  background: rgba(255, 255, 255, .7);
  border-color: rgba(113, 153, 162, .45);
}

.choice img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

.choice span {
  display: block;
  min-height: 24px;
  padding-top: 6px;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
}

.choice.is-active { background: rgba(255, 255, 255, .78); border-color: rgba(113, 153, 162, .55); }
.choice.is-choice-dodge { animation: choice-dodge .82s cubic-bezier(.16, .84, .3, 1) both; }
.choice.is-choice-listen { animation: choice-listen .86s cubic-bezier(.24, .78, .3, 1) both; }
.choice.is-choice-light { animation: choice-light .92s cubic-bezier(.16, .84, .3, 1) both; }
.choice.is-choice-open { animation: choice-open .9s cubic-bezier(.18, .78, .28, 1) both; }
.choice.is-choice-shelter { animation: choice-shelter .9s cubic-bezier(.16, .84, .3, 1) both; }
.choice.is-choice-return { animation: choice-return .92s cubic-bezier(.16, .84, .3, 1) both; }

.interaction-reply {
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(168, 190, 180, .8);
  background: rgba(255, 255, 255, .3);
  color: var(--blue);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 13px;
  line-height: 1.8;
}

.interaction-reply.is-revealed { animation: reply-in .48s cubic-bezier(.18, .82, .27, 1) both; }

.closing {
  display: grid;
  gap: 14px;
  margin: 7px 0 58px;
  padding: 28px 0 4px;
  border-top: 1px solid var(--line);
}

.closing h2 {
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.55;
}

.closing p:not(.section-label) {
  max-width: 620px;
  margin: 0;
  color: #52656b;
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 16px;
  line-height: 2;
}

.closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.primary-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.primary-link {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f6fbfb;
}

.secondary-button { padding: 0 13px; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0 5px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.privacy .hero,
.privacy .story,
.privacy .story-intro,
.privacy .closing {
  filter: blur(5px) saturate(.65);
}

.privacy * {
  -webkit-user-select: none;
  user-select: none;
}

.privacy::after {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 8;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(37, 52, 59, .9);
  color: #fff;
  content: "雾面保护已开启";
  font-size: 11px;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes dodge-right {
  0%, 100% { transform: translateX(0) rotate(0); }
  28% { transform: translateX(24px) translateY(-5px) rotate(3deg); }
  58% { transform: translateX(49px) translateY(4px) rotate(6deg); }
  82% { transform: translateX(18px) translateY(0) rotate(2deg); }
}

@keyframes dodge-left {
  0%, 100% { transform: translateX(0) rotate(0); }
  28% { transform: translateX(-24px) translateY(-5px) rotate(-3deg); }
  58% { transform: translateX(-49px) translateY(4px) rotate(-6deg); }
  82% { transform: translateX(-18px) translateY(0) rotate(-2deg); }
}

@keyframes cat-hug {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  28% { transform: translate(-8px, -7px) rotate(-3deg); }
  55% { transform: translate(9px, -13px) rotate(4deg); }
  80% { transform: translate(2px, 0) rotate(1deg); }
}

@keyframes cat-peek {
  0%, 100% { transform: translate(0, 0) rotate(0); opacity: 1; }
  30% { transform: translate(-18px, 3px) rotate(-4deg); opacity: .84; }
  58% { transform: translate(4px, -7px) rotate(2deg); opacity: 1; }
  82% { transform: translate(-2px, 0) rotate(0); }
}

@keyframes cat-settle {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  28% { transform: translate(-5px, -10px) rotate(-2deg); }
  55% { transform: translate(6px, -4px) rotate(2deg); }
  82% { transform: translate(0, 2px) rotate(0); }
}

@keyframes cat-turn {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  28% { transform: translate(10px, -3px) rotate(7deg); }
  57% { transform: translate(16px, 4px) rotate(11deg); }
  82% { transform: translate(3px, 0) rotate(2deg); }
}

@keyframes choice-dodge {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(-7px) rotate(-2deg); }
  58% { transform: translateX(9px) rotate(2deg); }
  82% { transform: translateX(0); }
}

@keyframes choice-listen {
  0%, 100% { transform: translateY(0); }
  32% { transform: translateY(-8px) rotate(-2deg); }
  64% { transform: translateY(-4px) rotate(2deg); }
}

@keyframes choice-light {
  0%, 100% { transform: translateY(0); box-shadow: 0 8px 18px rgba(42, 61, 67, .06); }
  45% { transform: translateY(-3px); box-shadow: 0 0 0 7px rgba(168, 190, 180, .18), 0 13px 24px rgba(42, 61, 67, .1); }
}

@keyframes choice-open {
  0%, 100% { transform: translateX(0) rotate(0); }
  34% { transform: translateX(7px) rotate(2deg); }
  66% { transform: translateX(-5px) rotate(-2deg); }
}

@keyframes choice-shelter {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(7px) rotate(-1deg); }
  67% { transform: translateY(-3px) rotate(1deg); }
}

@keyframes choice-return {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(9px); }
  65% { transform: translateX(-7px); }
}

@keyframes reply-in {
  from { opacity: 0; transform: translateY(7px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@media (min-width: 680px) {
  .page-shell { padding-left: 34px; padding-right: 34px; }
  .hero { grid-template-columns: minmax(0, 1.12fr) minmax(250px, .88fr); gap: 36px; }
  .hero h1 { font-size: 52px; }
  .hero-cat-wrap { min-height: 360px; }
  .story-beat { padding-left: 34px; }
  .beat-title { font-size: 34px; }
  .beat-body p,
  .closing p:not(.section-label) { font-size: 17px; }
}

@media (max-width: 420px) {
  .page-shell { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 35px; }
  .hero-signature { display: grid; gap: 3px; }
  .beat-scene { grid-template-columns: 106px minmax(0, 1fr); gap: 12px; }
  .choice-row { gap: 6px; }
  .choice { min-height: 82px; }
  .choice img { width: 43px; height: 43px; }
  .choice span { font-size: 9px; }
  .closing-actions { display: grid; }
  .primary-link,
  .secondary-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
