:root {
  --bg: #f5ede7;
  --bg-soft: #faf5f1;
  --paper: rgba(255, 251, 247, 0.76);
  --paper-strong: rgba(255, 250, 246, 0.92);
  --text: #2d2926;
  --muted: #7d726c;
  --line: rgba(132, 111, 96, 0.18);
  --accent: #bf8b9d;
  --accent-deep: #ae7387;
  --accent-soft: rgba(191, 139, 157, 0.11);
  --shadow: 0 16px 48px rgba(82, 60, 54, 0.10);
  --shadow-soft: 0 10px 26px rgba(82, 60, 54, 0.07);
  --max-width: 860px;
}

body.dark {
  --bg: #0e131b;
  --bg-soft: #141a23;
  --paper: rgba(24, 29, 37, 0.76);
  --paper-strong: rgba(27, 33, 42, 0.92);
  --text: #ece8e1;
  --muted: #b7afb2;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #c39ca8;
  --accent-deep: #ac7d8a;
  --accent-soft: rgba(195, 156, 168, 0.13);
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  position: relative;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    "Noto Serif SC",
    "Songti SC",
    "STSong",
    "Source Han Serif SC",
    "PingFang SC",
    "Microsoft YaHei",
    serif;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.35s ease, color 0.35s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.spring-bg {
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(248, 242, 239, 0.72), rgba(245, 237, 231, 0.88)),
    radial-gradient(circle at 14% 18%, rgba(236, 189, 205, 0.24), transparent 18%),
    radial-gradient(circle at 84% 15%, rgba(236, 197, 211, 0.18), transparent 22%),
    radial-gradient(circle at 76% 80%, rgba(241, 221, 228, 0.12), transparent 18%),
    linear-gradient(to bottom, #fbf7f6 0%, #f8f2ef 28%, #f2ebe5 60%, #ece4dc 100%);
}

body.dark .spring-bg {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 204, 132, 0.16), transparent 18%),
    radial-gradient(circle at 82% 24%, rgba(255, 216, 150, 0.12), transparent 16%),
    radial-gradient(circle at 50% 78%, rgba(255, 218, 170, 0.06), transparent 18%),
    linear-gradient(to bottom, rgba(11, 16, 24, 0.92), rgba(15, 21, 30, 0.96)),
    linear-gradient(to bottom, #131922 0%, #111822 42%, #0d1219 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.14), transparent 12%),
    radial-gradient(circle at 74% 20%, rgba(255, 255, 255, 0.10), transparent 10%),
    radial-gradient(circle at 64% 72%, rgba(255, 255, 255, 0.08), transparent 9%);
  filter: blur(18px);
}

body.dark::before {
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 214, 150, 0.10), transparent 12%),
    radial-gradient(circle at 74% 20%, rgba(255, 208, 138, 0.08), transparent 10%),
    radial-gradient(circle at 64% 72%, rgba(255, 236, 200, 0.04), transparent 9%);
}

.sakura-canopy,
.branch,
.petal-layer {
  pointer-events: none;
}

.sakura-canopy {
  position: fixed;
  z-index: -3;
  width: 42vmax;
  height: 22vmax;
  filter: blur(8px);
  opacity: 0.58;
}

.sakura-canopy::before,
.sakura-canopy::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(243, 196, 212, 0.72) 0%, rgba(232, 183, 200, 0.52) 45%, rgba(255, 241, 246, 0) 72%);
}

.sakura-canopy::before {
  inset: 0 18% 16% 0;
}

.sakura-canopy::after {
  inset: 8% 0 0 22%;
}

.sakura-left {
  top: -4vmax;
  left: -8vmax;
  transform: rotate(-12deg);
}

.sakura-right {
  top: -5vmax;
  right: -8vmax;
  transform: rotate(9deg);
}

body.dark .sakura-canopy::before,
body.dark .sakura-canopy::after {
  background:
    radial-gradient(circle, rgba(170, 124, 144, 0.30) 0%, rgba(142, 102, 121, 0.18) 42%, rgba(255, 241, 246, 0) 72%);
}

.branch {
  position: fixed;
  z-index: -2;
  width: 34vmax;
  height: 4px;
  background: linear-gradient(90deg, rgba(121, 85, 72, 0.0), rgba(121, 85, 72, 0.38), rgba(121, 85, 72, 0.0));
  border-radius: 999px;
  transform-origin: center;
  opacity: 0.44;
}

.branch::before,
.branch::after {
  content: "";
  position: absolute;
  width: 10vmax;
  height: 3px;
  background: inherit;
  border-radius: 999px;
}

.branch-left {
  top: 10vmax;
  left: -4vmax;
  transform: rotate(18deg);
}

.branch-left::before {
  left: 34%;
  top: -2.2vmax;
  transform: rotate(-28deg);
}

.branch-left::after {
  left: 58%;
  top: 1.8vmax;
  transform: rotate(22deg);
}

.branch-right {
  top: 9vmax;
  right: -4vmax;
  transform: rotate(-14deg);
}

.branch-right::before {
  left: 18%;
  top: 1.8vmax;
  transform: rotate(26deg);
}

.branch-right::after {
  left: 52%;
  top: -2vmax;
  transform: rotate(-24deg);
}

body.dark .branch {
  opacity: 0.16;
}

.night-lamp {
  position: fixed;
  bottom: -2vh;
  z-index: -2;
  width: 10px;
  height: 34vh;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(37, 43, 51, 0.0), rgba(57, 66, 77, 0.74) 22%, rgba(73, 82, 92, 0.88) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.night-lamp::before {
  content: "";
  position: absolute;
  top: 14%;
  width: 72px;
  height: 4px;
  border-radius: 999px;
  background: rgba(84, 95, 108, 0.92);
}

.night-lamp::after {
  content: "";
  position: absolute;
  top: calc(14% + 2px);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 237, 194, 0.95) 0%, rgba(255, 224, 156, 0.72) 32%, rgba(255, 206, 126, 0.22) 60%, rgba(255, 202, 120, 0) 74%);
  box-shadow:
    0 0 22px rgba(255, 214, 138, 0.55),
    0 0 58px rgba(255, 206, 126, 0.22);
}

.lamp-left {
  left: 8.5vw;
}

.lamp-left::before {
  left: 8px;
}

.lamp-left::after {
  left: 62px;
}

.lamp-right {
  right: 9.5vw;
}

.lamp-right::before {
  right: 8px;
}

.lamp-right::after {
  right: 62px;
}

body.dark .night-lamp {
  opacity: 1;
}

.petal-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -12vh;
  left: 0;
  width: var(--size);
  height: calc(var(--size) * 0.72);
  opacity: var(--opacity);
  background: linear-gradient(135deg, #f2cad8 0%, #e8bac9 48%, #faedf2 100%);
  border-radius: 70% 0 70% 0;
  box-shadow:
    0 0 8px rgba(235, 196, 210, 0.14),
    inset -1px -1px 3px rgba(255, 255, 255, 0.28);
  transform: rotate(var(--rotate));
  animation:
    petal-fall var(--fall-duration) linear infinite,
    petal-sway var(--sway-duration) ease-in-out infinite alternate;
  animation-delay: var(--delay), var(--delay);
}

body.dark .petal {
  background: linear-gradient(135deg, #b98da2 0%, #9c7085 48%, #d5bcc7 100%);
  box-shadow:
    0 0 8px rgba(180, 134, 154, 0.08),
    inset -1px -1px 3px rgba(255, 255, 255, 0.06);
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(var(--rotate));
  }
  100% {
    transform: translate3d(var(--drift), 118vh, 0) rotate(calc(var(--rotate) + 240deg));
  }
}

@keyframes petal-sway {
  0% {
    margin-left: -10px;
  }
  100% {
    margin-left: 18px;
  }
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.16);
  border-bottom: 1px solid var(--line);
}

body.dark .topbar {
  background: rgba(9, 12, 18, 0.28);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.site-name {
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.theme-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.93rem;
  transition: 0.25s ease;
  cursor: pointer;
}

.nav a:hover,
.theme-btn:hover {
  transform: translateY(-1px);
  background: var(--accent-soft);
}

.hero {
  position: relative;
  padding: 92px 0 44px;
}

.hero::after {
  content: "";
  position: absolute;
  right: 4%;
  top: 18%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(242, 204, 218, 0.18), transparent 68%);
  filter: blur(10px);
  z-index: -1;
}

body.dark .hero::after {
  background: radial-gradient(circle, rgba(255, 214, 146, 0.18), rgba(255, 199, 120, 0.06) 38%, transparent 70%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2.35rem, 7vw, 4.7rem);
  line-height: 1.14;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hero-text {
  margin-top: 22px;
  max-width: 680px;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 136px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition: 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fffaf5;
  border-color: transparent;
}

main {
  padding-bottom: 88px;
}

.section {
  margin-top: 28px;
}

.section-title {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.20);
}

.section-note {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 0.96rem;
}

.card,
.music-intro-card,
.floating-player {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 26px 24px;
  transition: transform 0.25s ease, background 0.35s ease, border-color 0.35s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.intro {
  position: relative;
  overflow: hidden;
}

.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 31px,
      rgba(195, 141, 161, 0.05) 32px
    );
  pointer-events: none;
}

.intro p,
.about p,
.footer {
  position: relative;
  z-index: 1;
}

.letters {
  display: grid;
  gap: 18px;
}

.letter-meta {
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.letter-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.16);
}

.letter-excerpt {
  margin: 0;
  color: var(--text);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tag {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
}

.quote-wall {
  display: grid;
  gap: 14px;
}

.quote {
  padding: 18px 18px;
  border-left: 3px solid var(--accent);
  background: var(--paper);
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.quote small {
  display: block;
  color: var(--muted);
  margin-top: 10px;
}

.about {
  color: var(--muted);
}

.divider {
  height: 1px;
  margin: 26px 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.footer {
  padding: 28px 0 52px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: rise 0.8s ease forwards;
}

.fade-delay-1 { animation-delay: 0.08s; }
.fade-delay-2 { animation-delay: 0.16s; }
.fade-delay-3 { animation-delay: 0.24s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.music-intro {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 18, 18, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.music-intro.hidden {
  display: none;
}

.music-intro-card {
  width: min(92%, 420px);
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
  text-align: center;
}

.music-intro-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--text);
}

.music-intro-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.music-intro-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.music-main-btn,
.music-sub-btn,
.floating-player {
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: 0.25s ease;
}

.music-main-btn {
  padding: 11px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fffaf5;
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}

.music-sub-btn {
  padding: 11px 18px;
  background: transparent;
  color: var(--text);
}

.music-main-btn:hover,
.music-sub-btn:hover,
.floating-player:hover {
  transform: translateY(-1px);
}

.floating-player {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 998;
  padding: 11px 16px;
  background: var(--paper-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.floating-player:active {
  transform: translateY(0);
}

@media (max-width: 700px) {
  .topbar-inner {
    min-height: 72px;
    align-items: flex-start;
    padding: 10px 0;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding-top: 60px;
  }

  .hero::after {
    width: 120px;
    height: 120px;
    right: 2%;
    top: 10%;
  }

  .card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .hero-text {
    font-size: 1rem;
  }

  .floating-player {
    right: 14px;
    bottom: 14px;
    padding: 10px 14px;
    font-size: 0.92rem;
  }

  .music-intro-card {
    padding: 24px 18px;
    border-radius: 20px;
  }

  .sakura-canopy {
    width: 52vmax;
    height: 28vmax;
  }

  .branch {
    width: 42vmax;
  }

  .night-lamp {
    height: 28vh;
  }

  .lamp-left {
    left: 3vw;
  }

  .lamp-right {
    right: 4vw;
  }

  .night-lamp::before {
    width: 56px;
  }

  .lamp-left::after {
    left: 48px;
  }

  .lamp-right::after {
    right: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fade-in,
  .petal {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .petal-layer {
    display: none;
  }
}



/* ===== Mobile-first refinement ===== */
@media (max-width: 900px) {
  .container {
    width: min(94%, var(--max-width));
  }

  .hero::after {
    width: 170px;
    height: 170px;
    right: 1%;
    top: 10%;
  }

  .section-note,
  .letter-excerpt,
  .quote,
  .about,
  .footer,
  .music-intro-text {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 700px) {
  body {
    line-height: 1.85;
  }

  .container {
    width: min(94%, var(--max-width));
  }

  .topbar-inner {
    min-height: auto;
    align-items: flex-start;
    padding: 10px 0;
    flex-direction: column;
    gap: 10px;
  }

  .site-name {
    font-size: 0.94rem;
    letter-spacing: 0.08em;
  }

  .nav {
    width: calc(100% + 2px);
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    gap: 8px;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a,
  .theme-btn {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .hero {
    padding: 46px 0 24px;
  }

  .hero::after {
    width: 116px;
    height: 116px;
    right: 1%;
    top: 9%;
  }

  .eyebrow {
    margin-bottom: 10px;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

  h1 {
    font-size: clamp(1.9rem, 9vw, 2.9rem);
    line-height: 1.2;
    letter-spacing: 0.02em;
  }

  .hero-text {
    margin-top: 16px;
    max-width: none;
    font-size: 0.98rem;
  }

  .hero-text br {
    display: none;
  }

  .hero-actions {
    gap: 10px;
    margin-top: 20px;
  }

  .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 5px);
    padding: 11px 14px;
  }

  main {
    padding-bottom: 118px;
  }

  .section {
    margin-top: 22px;
  }

  .section-title {
    margin-bottom: 12px;
    font-size: 1.24rem;
  }

  .section-note {
    margin-bottom: 14px;
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .card {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .quote {
    padding: 16px 14px;
    border-radius: 14px;
  }

  .letter-meta {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .letter-title {
    margin-bottom: 8px;
    font-size: 1.12rem;
    line-height: 1.35;
  }

  .letter-excerpt,
  .quote,
  .about,
  .footer,
  .music-intro-text {
    font-size: 0.96rem;
  }

  .tags {
    gap: 8px;
    margin-top: 14px;
  }

  .tag {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .footer {
    padding: 22px 0 calc(76px + env(safe-area-inset-bottom));
    font-size: 0.88rem;
  }

  .floating-player {
    left: 50%;
    right: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100% - 28px);
    max-width: 360px;
    padding: 11px 14px;
    text-align: center;
    transform: translateX(-50%);
  }

  .floating-player:hover {
    transform: translateX(-50%) translateY(-1px);
  }

  .floating-player:active {
    transform: translateX(-50%);
  }

  .music-intro {
    padding: 16px;
  }

  .music-intro-card {
    width: min(100%, 360px);
    padding: 22px 16px;
    border-radius: 18px;
  }

  .music-intro-actions {
    flex-direction: column;
    gap: 10px;
  }

  .music-main-btn,
  .music-sub-btn {
    width: 100%;
    padding: 10px 14px;
  }

  .sakura-canopy {
    width: 46vmax;
    height: 24vmax;
    opacity: 0.42;
    filter: blur(10px);
  }

  .sakura-right,
  .branch-right,
  .lamp-right {
    display: none;
  }

  .branch-left {
    top: 13vmax;
    left: -10vmax;
    width: 50vmax;
    opacity: 0.28;
  }

  .night-lamp {
    height: 24vh;
  }

  .lamp-left {
    left: 2vw;
  }

  .night-lamp::before {
    width: 50px;
  }

  .lamp-left::after {
    left: 42px;
  }

  .petal {
    opacity: calc(var(--opacity) * 0.82);
  }
}

@media (max-width: 480px) {
  .container {
    width: min(95%, var(--max-width));
  }

  .topbar-inner {
    padding: 8px 0 10px;
  }

  .site-name {
    font-size: 0.9rem;
  }

  .nav a,
  .theme-btn {
    padding: 7px 11px;
    font-size: 0.86rem;
  }

  .hero {
    padding: 38px 0 18px;
  }

  h1 {
    font-size: clamp(1.72rem, 10vw, 2.3rem);
  }

  .hero-text {
    font-size: 0.94rem;
    line-height: 1.8;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    flex: 1 1 100%;
  }

  .card {
    padding: 16px 14px;
  }

  .section-title {
    font-size: 1.16rem;
  }

  .letter-title {
    font-size: 1.04rem;
  }

  .letter-meta,
  .section-note,
  .tag,
  .quote small {
    font-size: 0.78rem;
  }

  .sakura-canopy {
    width: 42vmax;
    height: 20vmax;
    opacity: 0.34;
  }

  .branch-left {
    top: 12vmax;
    width: 46vmax;
  }

  .night-lamp {
    width: 8px;
    height: 20vh;
  }

  .night-lamp::before {
    top: 16%;
    width: 42px;
  }

  .lamp-left::after {
    left: 36px;
    width: 18px;
    height: 18px;
  }
}
