/* ==========================================================================
   TianYi Sky Lab — 全站样式
   配色取自「缤纷乐」立绘：天空蓝 / 云白 / 淡紫灰阴影 / 星星黄·粉·薄荷 / 彩虹
   ========================================================================== */

@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-latin-wght.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-wght.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* sky */
  --sky-50: #f4f9ff;
  --sky-100: #e7f2fd;
  --sky-200: #d0e6fb;
  --sky-300: #b3d5f8;
  --sky-400: #92baf2;
  --sky-500: #6f9fe8;
  --sky-600: #5284d8;
  --sky-700: #3d68b8;
  --navy: #23365f;

  /* text */
  --ink: #2a3b63;
  --ink-2: #55678e;
  --ink-3: #8a99b8;

  /* cloud */
  --cloud: #ffffff;
  --cloud-2: #f7faff;
  --mist: #dde7f6;
  --lav: #a9b4dc;
  --lav-2: #cbd1ec;

  /* accents (stars / ribbon / eyes) */
  --star: #ffd76a;
  --pink: #ff9ec7;
  --mint: #86e0c6;
  --leaf: #a3d65e;
  --rose: #f49ab9;

  --rainbow: linear-gradient(90deg, #ffa3b5, #ffc994, #fff09a, #b5eba4, #9bd7ff, #b8a8ff);
  --rainbow-loop: linear-gradient(90deg, #ffa3b5, #ffc994, #fff09a, #b5eba4, #9bd7ff, #b8a8ff, #ffa3b5);
  --rainbow-v: linear-gradient(180deg, #ffa3b5, #ffc994, #f6e27a, #b5eba4, #9bd7ff, #b8a8ff);

  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius: 18px;
  --radius-sm: 12px;

  --shadow-cloud: 0 14px 34px -16px rgba(61, 104, 184, .38), 0 2px 8px -2px rgba(61, 104, 184, .10);
  --shadow-lift: 0 26px 48px -20px rgba(61, 104, 184, .48), 0 4px 12px -4px rgba(61, 104, 184, .14);
  --ring: 0 0 0 3px rgba(111, 159, 232, .45);

  --font-display: "Fredoka", "Nunito", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", sans-serif;
  --font-body: "Nunito", -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-soft: cubic-bezier(.45, 0, .2, 1);

  --wrap: 1180px;
  --header-h: 64px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--cloud-2);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--sky-600); text-decoration: none; }
a:hover { color: var(--sky-700); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
::selection { background: #cfe3ff; color: var(--navy); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }

/* page background: soft sky fading to cloud white */
.page-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(184, 168, 255, .16), transparent 60%),
    radial-gradient(900px 480px at 0% 20%, rgba(155, 215, 255, .22), transparent 60%),
    linear-gradient(180deg, #e9f3fe 0%, #f5f9ff 38%, #fbfdff 100%);
}

/* ---------- icons ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.site-header {
  position: fixed; z-index: 60; top: 14px; left: 50%;
  width: min(var(--wrap), calc(100% - 24px));
  height: var(--header-h);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 10px 34px -16px rgba(61, 104, 184, .45);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  transition: background .4s, box-shadow .4s, top .4s var(--ease-out), height .4s var(--ease-out);
}
.site-header.is-scrolled { background: rgba(255, 255, 255, .82); top: 10px; box-shadow: 0 14px 40px -18px rgba(61, 104, 184, .55); }

.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); padding-right: 6px; }
.brand:hover { color: var(--navy); }
.brand-badge {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 6px 14px -6px rgba(61, 104, 184, .6);
  transition: transform .8s var(--ease-spring);
}
.brand:hover .brand-badge { transform: rotate(360deg) scale(1.06); }
.brand-name {
  font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: .01em; line-height: 1;
  background: linear-gradient(120deg, var(--sky-700), var(--sky-500) 45%, #9b8cf0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.brand-name b { font-weight: 600; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 6px;
  height: 42px; padding: 0 16px; border-radius: 999px;
  color: var(--ink-2); font-weight: 700; font-size: 15px;
  transition: color .25s, background .25s;
}
.nav a:hover { color: var(--sky-700); background: rgba(255, 255, 255, .7); }
.nav a.is-active { color: var(--sky-700); background: #fff; box-shadow: 0 6px 16px -10px rgba(61, 104, 184, .6); }
.header-tools { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.tool-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: #fff; color: var(--sky-600);
  box-shadow: 0 6px 14px -8px rgba(61, 104, 184, .6);
  transition: transform .3s var(--ease-spring), background .3s;
}
.tool-btn:hover { transform: translateY(-2px) scale(1.05); }
.tool-btn .i { width: 20px; height: 20px; }
.menu-btn { display: none; }

/* top progress (page switch) */
.route-bar {
  position: fixed; z-index: 100; top: 0; left: 0; height: 3px; width: 100%;
  background: var(--rainbow-loop); background-size: 200% 100%;
  transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
  transition: transform .5s var(--ease-out), opacity .4s;
  animation: rainbow-slide 1.4s linear infinite;
}
.route-bar.is-on { opacity: 1; }

/* ---------- buttons / chips / tags ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 26px; border-radius: 999px; border: 0;
  font-weight: 800; font-size: 16px; letter-spacing: .02em;
  transition: transform .35s var(--ease-spring), box-shadow .35s;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8cc0fb 0%, #6f9fe8 50%, #5a86dc 100%);
  box-shadow: 0 14px 26px -12px rgba(61, 104, 184, .85), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(35, 54, 95, .12);
}
.btn-primary:hover { color: #fff; box-shadow: 0 18px 30px -12px rgba(61, 104, 184, .9), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn-primary::after {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); transition: left .7s var(--ease-out);
}
.btn-primary:hover::after { left: 120%; }
.btn-ghost {
  color: var(--sky-700); background: rgba(255, 255, 255, .78);
  box-shadow: 0 10px 22px -14px rgba(61, 104, 184, .7), inset 0 0 0 1.5px #fff;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover { color: var(--sky-700); background: #fff; }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--mist); background: #fff; color: var(--ink-2);
  font-weight: 700; font-size: 14px;
  transition: all .3s var(--ease-out);
}
.chip:hover { border-color: var(--sky-300); color: var(--sky-700); transform: translateY(-1px); }
.chip .n { font-family: var(--font-display); font-size: 12px; font-weight: 500; color: var(--ink-3); }
.chip.is-on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #8cc0fb, #6f9fe8); box-shadow: 0 8px 18px -10px rgba(61, 104, 184, .9); }
.chip.is-on .n { color: rgba(255, 255, 255, .85); }

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; color: var(--sky-700); background: var(--sky-100);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--sky-400)); display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--sky-400)) 25%, transparent); }

/* ==========================================================================
   HOME HERO
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100vh; height: 100svh; min-height: 660px; max-height: 1080px;
  background: #a9d0fa url("../img/bg/sky.webp") center 60% / cover no-repeat;
}
.hero::before { /* top glow, ties header to sky */
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 30% 42%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, rgba(127, 179, 240, .35), transparent 40%);
}
.hero-layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.hero-far { z-index: 1; }
.hero-band { z-index: 2; }
.hero-piano { z-index: 3; -webkit-mask: linear-gradient(180deg, #000 82%, transparent 97%); mask: linear-gradient(180deg, #000 82%, transparent 97%); }
.hero-char-wrap { z-index: 4; }
.hero-near { z-index: 5; }
.hero-fx { z-index: 6; pointer-events: none; }
.hero-content { z-index: 7; pointer-events: none; }
.hero-piano svg { pointer-events: auto; }
.floater { position: absolute; inset: 0; animation: float-char 6.5s var(--ease-soft) infinite; transform-origin: 70% 60%; }
.hero-staff { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

/* drifting clouds */
.cloud {
  position: absolute; left: 0; top: var(--y);
  width: var(--w); opacity: var(--o, 1);
  filter: drop-shadow(0 12px 18px rgba(118, 150, 214, .25));
  animation: drift var(--t, 90s) linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes drift {
  from { transform: translateX(calc(-1 * var(--w) - 40px)); }
  to { transform: translateX(calc(100vw + 40px)); }
}

/* character */
.hero-char {
  position: absolute;
  right: max(-2vw, calc(50% - 720px));
  bottom: 7%;
  height: min(86%, 900px, 61vw);
  aspect-ratio: 1706 / 1804;
}
.hero-char img {
  width: 100%; height: 100%; object-fit: contain; object-position: bottom right;
  filter: drop-shadow(0 30px 40px rgba(61, 104, 184, .28));
}
@keyframes float-char {
  0%, 100% { transform: translateY(0) rotate(-.5deg); }
  50% { transform: translateY(-16px) rotate(.5deg); }
}
/* rainbow staff svg */
.hero-staff path.staff-line { fill: none; stroke-width: 3; stroke-linecap: round; opacity: .9; }
.hero-staff .staff-glow { fill: none; stroke: #fff; stroke-width: 34; stroke-linecap: round; opacity: .35; filter: blur(6px); }
.hero-staff .staff-note { transform-box: fill-box; transform-origin: center; animation: note-bob 3.6s var(--ease-soft) infinite; }
@keyframes note-bob { 50% { transform: translateY(-8px) rotate(6deg); } }

/* content block */
.hero-copy {
  position: absolute; left: max(5vw, calc(50% - 590px)); top: 50%;
  transform: translateY(-46%);
  width: min(560px, 42vw);
  pointer-events: auto;
}
.hero-title {
  margin: 18px 0 10px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(54px, 8.2vw, 116px); line-height: .94; letter-spacing: -.01em;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-title .ch {
  position: relative; display: inline-block;
  color: transparent;
  background-image: linear-gradient(100deg, #4f7fd6 0%, #6f9fe8 30%, #ff9ec7 42%, #ffd76a 48%, #86e0c6 54%, #6f9fe8 66%, #3d68b8 100%);
  background-size: 400% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text;
  animation: title-shine 7s var(--ease-soft) infinite;
  animation-delay: calc(var(--i) * 60ms + 2.4s);
  filter: drop-shadow(0 3px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 12px 18px rgba(61, 104, 184, .35));
}
.hero-title .sp { display: inline-block; width: .28em; }
@keyframes title-shine {
  0%, 55% { background-position: 100% 0; }
  85%, 100% { background-position: 0% 0; }
}
.hero-tagline {
  margin: 0 0 6px; font-size: clamp(17px, 1.6vw, 21px); font-weight: 800; color: var(--navy);
  text-shadow: 0 1px 0 #fff, 0 0 18px rgba(255, 255, 255, .9);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* sound toggle */
.hero-sound {
  position: absolute; z-index: 9; right: max(20px, calc(50% - 590px)); bottom: 24px;
  width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .8); color: var(--sky-700); box-shadow: 0 8px 18px -12px rgba(61, 104, 184, .8);
}

/* bottom cloud band (shared with banner/footer) */
.cloud-band {
  position: absolute; left: 0; right: 0; bottom: -2px; height: 150px; pointer-events: none;
  background: url("../img/bg/cloud-band.webp") 0 100% / auto 100% repeat-x;
  animation: band-slide 160s linear infinite;
}
@keyframes band-slide { to { background-position: -2896px 100%; } }

/* piano */
.piano { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.piano .keys { filter: drop-shadow(0 14px 16px rgba(61, 104, 184, .25)); }
.piano .k { cursor: pointer; transition: fill .2s, transform .18s var(--ease-out); transform-box: fill-box; transform-origin: 50% 0%; }
.piano .kw { fill: url(#kw-grad); stroke: #b9c8e8; stroke-width: 1.2; stroke-linejoin: round; }
.piano .kb { fill: url(#kb-grad); stroke: #1b2a4d; stroke-width: 1; stroke-linejoin: round; }
.piano .kw:hover { fill: #eaf3ff; }
.piano .kb:hover { fill: #4a64aa; }
.piano .k.on { transform: scale(.96, .94); }
.piano .kw.on { fill: url(#kw-on); }
.piano .kb.on { fill: #6f9fe8; }
.piano .k.pre { opacity: 0; transform: translateY(18px); }
.piano .k.in { transition: opacity .5s, transform .6s var(--ease-spring), fill .2s; }

/* bubbles & particles */
.bubble {
  position: absolute; left: var(--x); bottom: -90px; width: var(--s); height: var(--s);
  pointer-events: auto; cursor: pointer; border-radius: 50%;
  animation: rise var(--d) linear forwards;
}
.bubble > i {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .95) 0 7%, rgba(255, 255, 255, 0) 17%),
    radial-gradient(circle at 72% 76%, rgba(255, 255, 255, .55) 0 4%, rgba(255, 255, 255, 0) 10%),
    radial-gradient(circle, rgba(255, 255, 255, .05) 55%, rgba(255, 255, 255, .45) 80%, rgba(255, 255, 255, .85) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 6px 18px -8px rgba(61, 104, 184, .35);
  animation: sway var(--sw) ease-in-out infinite alternate;
}
.bubble > i::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, #ffb3c7, #ffe29a, #b5f0c0, #a6dcff, #c9b6ff, #ffb3c7);
  -webkit-mask: radial-gradient(closest-side, transparent 74%, #000 90%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 74%, #000 90%, transparent 100%);
  opacity: .7; animation: spin 7s linear infinite;
}
.bubble.pop { animation: none; }
.bubble.pop > i { animation: pop .32s var(--ease-out) forwards; }
@keyframes rise { to { transform: translateY(calc(-1 * var(--h) - 160px)); } }
@keyframes sway { from { transform: translateX(-14px); } to { transform: translateX(14px); } }
@keyframes pop { 60% { transform: scale(1.25); opacity: .6; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

.fx-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.sparkle {
  position: absolute; left: 0; top: 0; width: var(--s, 12px); height: var(--s, 12px);
  background: var(--c, #fff);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, .9));
  animation: spark var(--d, .8s) var(--ease-out) forwards;
}
@keyframes spark {
  0% { transform: translate(var(--x0), var(--y0)) scale(.2) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x1), var(--y1)) scale(1) rotate(160deg); opacity: 0; }
}
.note-p {
  position: absolute; left: 0; top: 0; width: var(--s, 34px);
  animation: note-fly 1.6s var(--ease-out) forwards;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9));
}
@keyframes note-fly {
  0% { transform: translate(var(--x0), var(--y0)) scale(.3) rotate(-10deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--x1), var(--y1)) scale(1) rotate(var(--r, 12deg)); opacity: 0; }
}

.twinkle {
  position: absolute; width: var(--s); left: var(--x); top: var(--y);
  animation: twinkle var(--t, 3.6s) ease-in-out infinite; animation-delay: var(--d, 0s);
  filter: drop-shadow(0 4px 8px rgba(61, 104, 184, .25));
}
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.72) rotate(18deg); opacity: .7; } }
@keyframes star-pop { from { transform: scale(0) rotate(-90deg); } }

/* hero entrance (html.js only; body gets .is-ready) */
.js .hero .hero-far, .js .hero .hero-near { opacity: 0; transition: opacity 1.4s var(--ease-out); }
.js .hero .hero-char { opacity: 0; transform: translateY(70px) scale(.96); transition: opacity 1s var(--ease-out) .25s, transform 1.4s var(--ease-spring) .25s; }
.js .hero .hero-copy > * { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .9s var(--ease-spring); }
.js .hero .hero-title .ch { opacity: 0; transform: translateY(40px) scale(.6) rotate(-8deg); transition: opacity .5s var(--ease-out), transform .8s var(--ease-spring); transition-delay: calc(.45s + var(--i) * 45ms); }
.js .hero.is-ready .hero-far, .js .hero.is-ready .hero-near { opacity: 1; }
.js .hero.is-ready .hero-char { opacity: 1; transform: none; }
.js .hero.is-ready .hero-copy > * { opacity: 1; transform: none; }
.js .hero.is-ready .hero-copy > :nth-child(2) { transition-delay: 1.05s; }
.js .hero.is-ready .hero-copy > :nth-child(3) { transition-delay: 1.2s; }
.js .hero.is-ready .hero-title .ch { opacity: 1; transform: none; }
.js .hero-staff .staff-line, .js .hero-staff .staff-glow { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); }
.js .hero.is-ready .hero-staff .staff-line, .js .hero.is-ready .hero-staff .staff-glow { stroke-dashoffset: 0; transition: stroke-dashoffset 2.2s var(--ease-soft) 1s; }
.js .hero-staff .staff-note { opacity: 0; transition: opacity .6s; }
.js .hero.is-ready .hero-staff .staff-note { opacity: 1; transition-delay: calc(1.6s + var(--i) * .18s); }

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { position: relative; padding: 84px 0 40px; }
.section + .section { padding-top: 56px; }
.sec-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 26px; }
.sec-title { position: relative; margin: 0; font-size: clamp(24px, 2.6vw, 30px); line-height: 1.2; font-weight: 900; color: var(--navy); letter-spacing: .04em; }
.sec-title::after {
  content: ""; display: block; height: 4px; width: 40px; margin-top: 10px; border-radius: 4px;
  background: var(--rainbow); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1s var(--ease-out) .25s;
}
.is-in .sec-title::after, .sec-head.is-in .sec-title::after { transform: scaleX(1); }
.no-js .sec-title::after { transform: none; }
.sec-more { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; color: var(--sky-600); white-space: nowrap; }
.sec-more .i { transition: transform .3s var(--ease-spring); }
.sec-more:hover .i { transform: translateX(4px); }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-2deg); } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-bottom: 26px; }
.search {
  margin-left: auto; position: relative; display: flex; align-items: center;
}
.search input {
  width: 240px; height: 42px; padding: 0 16px 0 40px; border-radius: 999px; border: 1.5px solid var(--mist); background: #fff;
  font: inherit; font-size: 14px; color: var(--ink); outline: none; transition: border-color .3s, box-shadow .3s, width .4s var(--ease-out);
}
.search input:focus { border-color: var(--sky-400); box-shadow: var(--ring); width: 280px; }
.search .i { position: absolute; left: 14px; color: var(--ink-3); }

/* ---------- reveal ---------- */
.js [data-reveal] {
  opacity: 0; translate: 0 26px; scale: .985;
  transition: opacity .8s var(--ease-out) var(--delay, 0s), translate 1s var(--ease-spring) var(--delay, 0s), scale 1s var(--ease-spring) var(--delay, 0s),
    transform .5s var(--ease-spring), box-shadow .5s var(--ease-out), background .3s, color .3s;
}
.js [data-reveal].is-in { opacity: 1; translate: none; scale: none; }

/* ==========================================================================
   WORK CARDS
   ========================================================================== */
.grid { display: grid; gap: 26px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  --c: var(--sky-400);
  position: relative; display: flex; flex-direction: column;
  border-radius: var(--radius-lg); background: #fff; color: var(--ink);
  box-shadow: var(--shadow-cloud);
  transition: transform .5s var(--ease-spring), box-shadow .5s var(--ease-out);
  transform: perspective(900px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)) translateY(var(--ty, 0));
}
.card:hover { --ty: -8px; color: var(--ink); box-shadow: var(--shadow-lift); }
.card::before { /* rainbow ring */
  content: ""; position: absolute; inset: -2px; z-index: 2; border-radius: calc(var(--radius-lg) + 2px); padding: 2.5px; pointer-events: none;
  background: var(--rainbow-loop); background-size: 200% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .4s; animation: rainbow-slide 3s linear infinite;
}
.card:hover::before, .card:focus-visible::before { opacity: 1; }
@keyframes rainbow-slide { to { background-position: -200% 0; } }
.card-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--sky-100); }
.card-cover > img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease-out); }
.card:hover .card-cover > img { transform: scale(1.06); }
.card-kind {
  position: absolute; z-index: 1; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--sky-700);
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 6px 14px -8px rgba(61, 104, 184, .6);
}
.card-kind .i { width: 14px; height: 14px; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 20px; flex: 1; }
.card-title { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 900; color: var(--navy); }
.card-sum { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); font-weight: 700; }
.card-meta .coll { color: var(--ink-2); }
.card-meta time { margin-left: auto; font-family: var(--font-display); font-weight: 500; }

/* fallback cover */
.cover-fb {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .8), transparent 45%),
    linear-gradient(150deg, color-mix(in srgb, var(--c) 45%, #fff), color-mix(in srgb, var(--c) 85%, #fff));
}
.cover-fb img { width: 34%; max-width: 140px; filter: drop-shadow(0 12px 14px rgba(61, 104, 184, .25)); transition: transform .9s var(--ease-spring); }
.card:hover .cover-fb img { transform: translateY(-6px) rotate(-3deg) scale(1.05); }

.empty {
  display: grid; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--ink-2);
  border-radius: var(--radius-lg); background: rgba(255, 255, 255, .7); border: 2px dashed var(--mist);
}
.empty img { width: 120px; animation: bob 4s var(--ease-soft) infinite; }

/* ==========================================================================
   POSTS
   ========================================================================== */
.post-list { display: grid; gap: 16px; }
.post-row {
  position: relative; display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 20px; align-items: center;
  padding: 18px 22px 18px 18px; border-radius: 22px; background: #fff; color: var(--ink); box-shadow: var(--shadow-cloud);
  transition: transform .45s var(--ease-spring), box-shadow .45s;
  overflow: hidden;
}
.post-row::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 4px; border-radius: 4px; background: var(--rainbow-v); transform: scaleY(0); transition: transform .45s var(--ease-out); }
.post-row:hover { transform: translateX(6px); color: var(--ink); box-shadow: var(--shadow-lift); }
.post-row:hover::before { transform: scaleY(1); }
.post-date {
  display: grid; place-items: center; align-content: center; width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--sky-100)); box-shadow: inset 0 0 0 2px #fff, 0 8px 16px -10px rgba(61, 104, 184, .7);
  line-height: 1;
}
.post-date b { font-family: var(--font-display); font-weight: 600; font-size: 28px; color: var(--sky-700); }
.post-date small { margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--ink-3); }
.post-title { margin: 0 0 4px; font-size: 19px; font-weight: 900; color: var(--navy); line-height: 1.45; }
.post-sum { margin: 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ==========================================================================
   GALLERY
   ========================================================================== */
.strip { position: relative; overflow: hidden; padding: 6px 0 14px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.strip + .strip { margin-top: 4px; }
.strip-track { display: flex; gap: 16px; width: max-content; animation: marquee var(--t, 60s) linear infinite; }
.strip.rev .strip-track { animation-direction: reverse; }
.strip:hover .strip-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.strip .tile { height: 190px; width: auto; aspect-ratio: var(--ar, 4/3); }

.tile {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--sky-100);
  box-shadow: var(--shadow-cloud); cursor: zoom-in; border: 0; padding: 0;
  transition: transform .45s var(--ease-spring), box-shadow .45s;
}
.tile:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: var(--shadow-lift); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.tile:hover img { transform: scale(1.05); }
.tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; text-align: left;
  color: #fff; font-size: 14px; font-weight: 800; line-height: 1.4;
  background: linear-gradient(transparent, rgba(35, 54, 95, .62));
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .45s var(--ease-out);
}
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; transform: none; }
.tile-play {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%;
  display: grid; place-items: center; color: var(--sky-600); background: rgba(255, 255, 255, .88);
  box-shadow: 0 10px 20px -10px rgba(35, 54, 95, .7); transition: transform .4s var(--ease-spring), opacity .3s;
}
.tile-play .i { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; stroke: none; }
.tile:hover .tile-play { transform: scale(1.12); }
.tile.is-previewing .tile-play { opacity: 0; }

.masonry { columns: 300px; column-gap: 20px; }
.masonry .tile { width: 100%; margin: 0 0 20px; break-inside: avoid; aspect-ratio: var(--ar, 4/3); }

/* lightbox */
.lb {
  position: fixed; inset: 0; z-index: 120; display: grid; grid-template-rows: 1fr auto; place-items: center;
  padding: 70px 70px 24px;
  background: rgba(31, 52, 96, .5); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s;
}
.lb.is-open { opacity: 1; visibility: visible; }
.lb-stage { position: relative; display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; }
.lb-stage > img, .lb-stage > video {
  max-width: 100%; max-height: 100%; border-radius: 18px; background: #fff;
  box-shadow: 0 30px 80px -20px rgba(15, 30, 70, .7);
  transform: scale(.92); opacity: 0; transition: transform .5s var(--ease-spring), opacity .35s;
}
.lb.is-open .lb-stage > .is-shown { transform: none; opacity: 1; }
.lb-cap { margin-top: 16px; max-width: 760px; text-align: center; color: #fff; text-shadow: 0 2px 10px rgba(15, 30, 70, .6); }
.lb-cap b { display: block; font-size: 17px; }
.lb-cap span { font-size: 14px; opacity: .85; }
.lb-btn {
  position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .9); color: var(--sky-700); box-shadow: 0 10px 20px -10px rgba(15, 30, 70, .6);
  transition: transform .3s var(--ease-spring);
}
.lb-btn:hover { transform: scale(1.08); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; margin-top: -26px; }
.lb-next { right: 12px; top: 50%; margin-top: -26px; }
.lb-count { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); color: #fff; font-family: var(--font-display); letter-spacing: .1em; }

/* ==========================================================================
   INNER PAGE BANNER
   ========================================================================== */
.banner {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 300px; padding: calc(var(--header-h) + 60px) 0 100px;
  background: #b9dafc url("../img/bg/sky.webp") center 34% / cover no-repeat;
}
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(70% 90% at 20% 60%, rgba(255, 255, 255, .55), transparent 70%); }
.banner .wrap { position: relative; z-index: 3; display: flex; align-items: center; gap: 24px; }
.banner-title { margin: 4px 0 8px; font-size: clamp(34px, 5vw, 52px); line-height: 1.15; font-weight: 900; color: var(--navy); text-shadow: 0 2px 0 #fff, 0 0 26px rgba(255, 255, 255, .9); }
.banner-desc { margin: 0; max-width: 36em; color: var(--ink-2); font-weight: 700; text-shadow: 0 0 14px #fff, 0 0 2px #fff; }
.banner-emblem { margin-left: auto; width: clamp(110px, 14vw, 170px); flex: none; animation: bob 6s var(--ease-soft) infinite; filter: drop-shadow(0 16px 20px rgba(61, 104, 184, .3)); }
.banner .cloud-band { height: 120px; }
@keyframes peek { 0%, 70%, 100% { transform: translateY(0); } 78% { transform: translateY(14px); } 86% { transform: translateY(-4px); } }

/* ==========================================================================
   VIEWER
   ========================================================================== */
.viewer { padding: calc(var(--header-h) + 34px) 0 30px; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.viewer-bar h1 { margin: 0; font-size: 22px; font-weight: 900; color: var(--navy); line-height: 1.3; }
.viewer-bar .meta { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; font-weight: 700; }
.viewer-bar .acts { margin-left: auto; display: flex; gap: 8px; }
.frame-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); background: #fff;
  box-shadow: var(--shadow-lift); border: 3px solid #fff;
  height: calc(100svh - var(--header-h) - 150px); min-height: 480px;
}
.frame-card iframe, .frame-card video { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.frame-card video { object-fit: contain; background: #0f1a33; }
.frame-loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--sky-100), #fff); color: var(--ink-2); font-weight: 800;
  transition: opacity .5s, visibility .5s;
}
.frame-loading img { width: 110px; animation: hop .9s var(--ease-soft) infinite; }
.frame-loading.is-done { opacity: 0; visibility: hidden; }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.1, .9); } 50% { transform: translateY(-26px) scale(.95, 1.05); } }
.viewer-desc { margin: 18px 0 0; color: var(--ink-2); }

/* ==========================================================================
   ARTICLE
   ========================================================================== */
.read-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 34px; align-items: start; margin-top: -60px; position: relative; z-index: 5; }
.read-main { min-width: 0; }
.article { padding: 44px clamp(22px, 5vw, 60px) 50px; border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-cloud); min-width: 0; }
.toc { position: sticky; top: calc(var(--header-h) + 34px); padding: 20px; border-radius: var(--radius-lg); background: rgba(255, 255, 255, .85); box-shadow: var(--shadow-cloud); font-size: 14px; }
.toc h4 { margin: 0 0 10px; font-size: 14px; color: var(--navy); display: flex; gap: 6px; align-items: center; }
.toc a { display: block; padding: 5px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 700; line-height: 1.45; transition: background .25s, color .25s; }
.toc a.l3 { padding-left: 24px; font-weight: 600; font-size: 13px; }
.toc a:hover { background: var(--sky-50); color: var(--sky-700); }
.toc a.is-on { background: var(--sky-100); color: var(--sky-700); }
.post-head-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.post-nav a { padding: 16px 20px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-cloud); color: var(--navy); font-weight: 800; transition: transform .4s var(--ease-spring); }
.post-nav a small { display: block; color: var(--ink-3); font-size: 12px; letter-spacing: .1em; }
.post-nav a:hover { transform: translateY(-4px); }
.post-nav .next { text-align: right; grid-column: 2; }

.prose { font-size: 17px; line-height: 1.9; color: var(--ink); word-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--navy); line-height: 1.4; scroll-margin-top: calc(var(--header-h) + 30px); }
.prose h2 { position: relative; margin: 2.2em 0 .8em; padding-left: 16px; font-size: 1.45em; font-weight: 900; }
.prose h2::before { content: ""; position: absolute; left: 0; top: .28em; bottom: .28em; width: 4px; border-radius: 4px; background: var(--sky-400); }
.prose h3 { margin: 1.8em 0 .6em; font-size: 1.2em; font-weight: 900; }
.prose p { margin: 0 0 1.15em; }
.prose a { color: var(--sky-600); font-weight: 700; background: linear-gradient(var(--sky-200), var(--sky-200)) 0 100% / 100% 2px no-repeat; transition: background-size .3s; }
.prose a:hover { background-size: 100% 100%; border-radius: 4px; }
.prose strong { color: var(--navy); font-weight: 900; }
.prose img, .prose video { margin: 1.4em auto; border-radius: 16px; box-shadow: var(--shadow-cloud); }
.prose figure { margin: 1.6em 0; }
.prose figcaption, .prose img + em { display: block; text-align: center; color: var(--ink-3); font-size: 14px; margin-top: -.6em; }
.prose blockquote {
  margin: 1.4em 0; padding: 14px 20px 14px 22px; border-radius: 16px; position: relative;
  background: linear-gradient(135deg, var(--sky-50), #fff); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--sky-100);
}
.prose blockquote::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 4px; background: var(--rainbow-v); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: .3em 0; }
.prose ul li::marker { color: var(--sky-400); }
.prose code { font-family: var(--font-mono); font-size: .86em; padding: .15em .45em; border-radius: 6px; background: var(--sky-50); color: #3a5aa8; }
.prose pre { margin: 1.4em 0; padding: 18px 20px; border-radius: 16px; background: #f2f7ff; overflow-x: auto; line-height: 1.65; box-shadow: inset 0 0 0 1px var(--sky-100); }
.prose pre code { padding: 0; background: none; color: var(--ink); font-size: 14px; }
.prose hr { border: 0; height: 1px; margin: 2.2em 0; background: var(--mist); }
.prose .table-wrap { margin: 1.4em 0; overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--sky-100); }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.prose th { background: var(--sky-100); color: var(--navy); font-weight: 900; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--sky-100); }
.prose th { white-space: nowrap; }
.prose td { min-width: 6em; }  /* 窄屏下表格横向滚动，而不是把列压成一字一行 */
.prose tr:nth-child(even) td { background: var(--sky-50); }
.prose .anchor { position: absolute; margin-left: 8px; opacity: 0; color: var(--sky-400); background: none; font-weight: 600; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose h3 { position: relative; }
@media (hover: none) { .prose .anchor { display: none; } }
/* 文章里的嵌入页 / 视频 / 完整版入口 */
.prose video { width: 100%; background: #000; }
.prose iframe.embed { display: block; width: 100%; height: 440px; margin: 1.6em 0; border: 0; border-radius: 18px; background: var(--cloud-2); box-shadow: var(--shadow-cloud); }
.prose figure > img, .prose figure > video, .prose figure > iframe.embed { margin-bottom: .9em; }
.prose figure > figcaption { margin-top: 0; }
.prose .tldr { margin: 0 0 1.6em; padding: 16px 20px; border-radius: 16px; background: var(--sky-50); box-shadow: inset 0 0 0 1px var(--sky-100); color: var(--navy); font-weight: 700; }
.prose a.lock-card { display: flex; align-items: center; gap: 14px; margin: 2em 0 0; padding: 16px 20px; border-radius: 18px; background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; border: 2px solid transparent; color: var(--navy); box-shadow: var(--shadow-cloud); transition: transform .3s var(--ease-out), box-shadow .3s; }
.prose a.lock-card:hover { background: linear-gradient(#fff, #fff) padding-box, var(--rainbow) border-box; transform: translateY(-3px); box-shadow: var(--shadow-lift); border-radius: 18px; }
.prose a.lock-card b { display: block; font-size: 16px; }
.prose a.lock-card small { display: block; color: var(--ink-2); font-weight: 600; font-size: 14px; line-height: 1.5; }
.unlock-card { display: grid; gap: 14px; padding: 30px; border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-cloud); }
.unlock-card input { width: 100%; padding: 12px 16px; border: 2px solid var(--sky-200); border-radius: 14px; font: inherit; font-size: 17px; color: var(--ink); background: var(--sky-50); outline: none; transition: border-color .2s, box-shadow .2s; }
.unlock-card input:focus { border-color: var(--sky-500); box-shadow: var(--ring); }
.unlock-card .unlock-err { margin: 0; color: #d0477a; font-weight: 700; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer { position: relative; margin-top: 170px; padding: 6px 0 100px; background: #fff; }
.site-footer .cloud-band { top: -138px; bottom: auto; height: 140px; animation-duration: 200s; }
.footer-bunny { position: absolute; left: max(16px, calc(50% - 560px)); top: -96px; width: 96px; pointer-events: none; }
.footer-inner { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.footer-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; color: var(--navy); }
.footer-links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.footer-links a { padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.footer-links a:hover { background: var(--sky-50); color: var(--sky-700); }
.footer-note { width: 100%; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-3); font-weight: 600; }

/* ==========================================================================
   FLOATING: music dock + back-to-top bunny
   ========================================================================== */
.dock { position: fixed; z-index: 70; left: 18px; bottom: 18px; display: flex; align-items: flex-end; gap: 12px; }
.dock-disc {
  position: relative; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%;
  background: repeating-radial-gradient(circle, #2f4479 0 2px, #263a6b 2px 4px);
  box-shadow: 0 12px 24px -10px rgba(35, 54, 95, .8), inset 0 0 0 3px #fff;
  display: grid; place-items: center;
  transition: transform .4s var(--ease-spring);
}
.dock-disc:hover { transform: scale(1.08) rotate(-8deg); }
.dock-disc img { width: 64%; height: 64%; border-radius: 50%; border: 2px solid #fff; animation: spin 7s linear infinite; animation-play-state: paused; }
.is-playing .dock-disc img { animation-play-state: running; }
.dock-panel {
  width: min(360px, calc(100vw - 100px));
  border-radius: 22px; background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-lift); border: 1px solid #fff;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 8px; transform-origin: 0 100%;
  opacity: 0; visibility: hidden; transform: translateY(10px) scale(.92);
  transition: opacity .3s, visibility .3s, transform .45s var(--ease-spring);
}
.dock.is-open .dock-panel { opacity: 1; visibility: visible; transform: none; }
.dock-panel .empty-tip { padding: 14px; font-size: 14px; color: var(--ink-2); }
.dock-panel .empty-tip code { font-size: 12px; background: var(--sky-50); padding: 2px 6px; border-radius: 6px; }

.to-top {
  position: fixed; z-index: 70; right: 18px; bottom: 18px; width: 76px; height: 86px; border: 0; padding: 0; background: none;
  opacity: 0; visibility: hidden; transform: translateY(30px);
  transition: opacity .35s, visibility .35s, transform .5s var(--ease-spring);
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top img { width: 100%; filter: drop-shadow(0 10px 12px rgba(61, 104, 184, .35)); transition: transform .4s var(--ease-spring); }
.to-top:hover img { transform: translateY(-6px) rotate(-6deg); }
.to-top.fly img { animation: fly-up .9s var(--ease-out) forwards; }
@keyframes fly-up { 0% { transform: translateY(0) scale(1, 1); } 20% { transform: translateY(6px) scale(1.15, .85); } 100% { transform: translateY(-110vh) scale(.9, 1.1); } }

/* APlayer — sky skin (normal mode inside .dock-panel) */
.dock .aplayer { margin: 0; border-radius: 16px; box-shadow: none; background: transparent; font-family: var(--font-body); overflow: visible; }
.dock .aplayer .aplayer-body { border-radius: 16px; }
.dock .aplayer .aplayer-pic { width: 66px; height: 66px; border-radius: 50%; margin: 2px; box-shadow: 0 6px 14px -6px rgba(35, 54, 95, .6); }
.dock .aplayer.aplayer-withlrc .aplayer-pic { width: 66px; height: 66px; }
.dock .aplayer .aplayer-info { margin-left: 72px; height: 70px; border-bottom: 0; padding: 6px 7px 0 12px; }
.dock .aplayer .aplayer-info .aplayer-music .aplayer-title { font-weight: 900; color: var(--navy); font-size: 15px; }
.dock .aplayer .aplayer-info .aplayer-music .aplayer-author { color: var(--ink-3); font-weight: 700; }
.dock .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar { height: 4px; border-radius: 4px; background: var(--sky-100); }
.dock .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded { height: 4px; border-radius: 4px; background: var(--sky-200); }
.dock .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played { height: 4px; border-radius: 4px; background: linear-gradient(90deg, #8cc0fb, #6f9fe8) !important; }
.dock .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb { width: 12px; height: 12px; margin-top: -4px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(35, 54, 95, .4); }
.dock .aplayer .aplayer-pic .aplayer-button { background: rgba(35, 54, 95, .45); }
.dock .aplayer .aplayer-list { margin-top: 6px; border-radius: 14px; }
.dock .aplayer .aplayer-list ol { max-height: 220px; }
.dock .aplayer .aplayer-list ol li { border-top: 0; border-radius: 10px; margin: 2px 4px; }
.dock .aplayer .aplayer-list ol li.aplayer-list-light { background: var(--sky-100); }
.dock .aplayer .aplayer-list ol li:hover { background: var(--sky-50); }
.dock .aplayer .aplayer-lrc { display: none; }

/* ==========================================================================
   404
   ========================================================================== */
.lost { position: relative; min-height: 100svh; display: grid; place-items: center; text-align: center; overflow: hidden; background: #b9dafc url("../img/bg/sky.webp") center / cover; padding: 120px 20px 160px; }
.lost h1 { margin: 6px 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(90px, 18vw, 180px); line-height: 1; color: #fff; text-shadow: 0 10px 30px rgba(61, 104, 184, .45); letter-spacing: .04em; }
.lost p { margin: 0 0 24px; font-weight: 800; color: var(--navy); font-size: 18px; text-shadow: 0 0 12px #fff; }
.lost-clouds { position: absolute; inset: 0; pointer-events: none; }
.lost-box { position: relative; z-index: 2; }
.lost .bunny { width: 150px; margin: 0 auto; animation: peek 5s var(--ease-soft) infinite; }

/* ==========================================================================
   VIEW TRANSITIONS / MOTION PREFS
   ========================================================================== */
::view-transition-old(main), ::view-transition-new(main) { animation-duration: .45s; animation-timing-function: var(--ease-out); }
::view-transition-old(main) { animation-name: vt-out; }
::view-transition-new(main) { animation-name: vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }
#main { view-transition-name: main; }
.main-fade { animation: vt-in .5s var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .cloud { animation: none; transform: translateX(calc(var(--start, 30) * 1vw)); }
  .cloud-band, .strip-track { animation: none !important; }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .read-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .hero-copy { width: min(500px, 43vw); }
}
@media (max-width: 860px) {
  :root { --header-h: 58px; }
  .site-header { top: 10px; }
  .brand-badge { width: 40px; height: 40px; }
  .brand-name { font-size: 18px; }
  .menu-btn { display: grid; }
  .nav {
    position: absolute; top: calc(100% + 10px); right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 10px;
    border-radius: 24px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-lift);
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98); transform-origin: 50% 0;
    transition: opacity .25s, visibility .25s, transform .35s var(--ease-spring);
  }
  .site-header.menu-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav a { height: 48px; padding: 0 16px; justify-content: flex-start; }
  .header-tools { margin-left: auto; }

  .hero { height: auto; min-height: 0; max-height: none; padding: calc(var(--header-h) + 34px) 0 0; display: flex; flex-direction: column; }
  .hero-content { position: relative; inset: auto; order: 2; }
  .hero-copy { position: relative; left: auto; top: auto; transform: none; width: auto; margin: 0 20px; padding-bottom: 200px; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-char-wrap { position: relative; inset: auto; order: 1; height: 62vw; max-height: 460px; min-height: 280px; }
  .hero-char { left: 0; right: 0; margin-inline: auto; bottom: 0; height: 100%; }
  .hero-sound { bottom: 16px; right: 16px; }
  .hero-title { font-size: clamp(46px, 13vw, 80px); }

  .banner { min-height: 240px; padding: calc(var(--header-h) + 36px) 0 90px; }
  .banner-emblem { width: 110px; }
  .search { margin-left: 0; width: 100%; }
  .search input, .search input:focus { width: 100%; }
  .lb { padding: 64px 12px 16px; }
  .lb-prev, .lb-next { top: auto; bottom: 18px; margin: 0; }
  .lb-prev { left: 18px; } .lb-next { right: 18px; }
  .frame-card { height: calc(100svh - var(--header-h) - 190px); min-height: 420px; }
  .footer-links { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .post-row { grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .post-date { width: 58px; height: 58px; }
  .post-date b { font-size: 22px; }
  .strip .tile { height: 140px; }
  .masonry { columns: 2; column-gap: 12px; }
  .masonry .tile { margin-bottom: 12px; }
  .banner .wrap { flex-direction: column-reverse; align-items: flex-start; }
  /* 手机上徽章放在标题上方靠右，不压住长标题 */
  .banner-emblem { align-self: flex-end; width: 72px; margin: -12px 0 -4px; opacity: .9; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { grid-column: 1; }
  .dock { left: 12px; bottom: 12px; }
  .to-top { right: 10px; bottom: 12px; width: 62px; height: 70px; }
  .brand-name { font-size: 16px; }
}
