:root {
  --bg-1: #ffe7f3;
  --bg-2: #efe5ff;
  --bg-3: #dff5ff;
  --ink: #2b2550;
  --soft-ink: #5c5780;
  --line: rgba(103, 83, 170, 0.24);
  --primary: #ff4d9d;
  --primary-deep: #ff2f7f;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-2: rgba(255, 255, 255, 0.96);
  --link: #6b5aa7;
  --footer-ink: #7a6ba5;
  --section-separator: rgba(0, 0, 0, 0.14);
  --cover-bg-image: url("https://outer-pictures.oss-cn-beijing.aliyuncs.com/blog/assets/hero-bg.jpg");
}

html[data-theme="dark"] {
  --bg-1: #12121f;
  --bg-2: #1b1a30;
  --bg-3: #0f2533;
  --ink: #ece8ff;
  --soft-ink: #c5c0e8;
  --line: rgba(161, 145, 230, 0.34);
  --primary: #ff63b0;
  --primary-deep: #ff3f94;
  --surface: rgba(27, 30, 52, 0.82);
  --surface-2: rgba(32, 36, 63, 0.95);
  --link: #c3b6ff;
  --footer-ink: #b2a8df;
  --section-separator: rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Baloo 2", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 77, 157, 0.18) 0, rgba(255, 77, 157, 0) 28%),
    radial-gradient(circle at 88% 10%, rgba(52, 199, 245, 0.16) 0, rgba(52, 199, 245, 0) 28%),
    linear-gradient(140deg, var(--bg-1) 0%, var(--bg-2) 46%, var(--bg-3) 100%);
  overflow-x: hidden;
}

body,
a,
.btn,
.story-copy h2,
.story-copy p,
.story-copy ul,
.site-footer,
.sns-links a,
.friend-links a {
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
}

.sakura-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.62) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.32) 1px, transparent 1px);
  background-size: 24px 24px, 36px 36px;
  background-position: 0 0, 13px 18px;
  opacity: 0.5;
}

html[data-theme="dark"] .page-bg::before {
  opacity: 0.18;
}

.theme-toggle {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  background: var(--surface-2);
  box-shadow: 0 10px 24px rgba(18, 14, 36, 0.18);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.cover {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  margin-left: calc(50% - 50vw);
  display: grid;
  place-items: center;
  text-align: center;
  background-image:
    linear-gradient(rgba(28, 24, 52, 0.28), rgba(28, 24, 52, 0.28)),
    var(--cover-bg-image);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 220px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffeef7 82%, #ffe7f3 100%);
}

html[data-theme="dark"] .cover::after {
  background: linear-gradient(to bottom, rgba(16, 16, 27, 0) 0%, rgba(16, 16, 27, 0.85) 82%, #12121f 100%);
}

.cover-inner {
  position: relative;
  z-index: 1;
  padding: 1.2rem;
}

.cover-title {
  margin: 0;
  font-family: "ZCOOL KuaiLe", cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.cover-sub {
  margin: 0.8rem 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.cover-scroll {
  display: inline-flex;
  width: 42px;
  height: 42px;
  margin-top: 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.16);
  animation: bounce 1.9s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(7px); }
}

header,
footer {
  width: min(980px, calc(100% - 2rem));
  margin-inline: auto;
}

main {
  width: 100%;
}

.hero {
  position: relative;
  text-align: center;
  padding: 4.6rem 1rem 3.2rem;
}

.tag {
  display: inline-block;
  margin: 0;
  font-size: 0.95rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  color: #6d2a7a;
  background: var(--surface);
  border: 1px solid var(--line);
}

h1,
h2,
h3 {
  margin: 0;
}

.hero h1 {
  margin-top: 0.95rem;
  font-family: "ZCOOL KuaiLe", cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.1;
  color: #ff2f7f;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(52, 199, 245, 0.45);
}

.subtitle {
  margin: 1rem auto 0;
  max-width: 640px;
  color: var(--soft-ink);
  font-size: 1.12rem;
  line-height: 1.75;
}

.hero-actions {
  margin-top: 1.4rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  text-decoration: none;
  border-radius: 14px;
  padding: 0.68rem 1.15rem;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.btn.primary {
  color: #fff;
  background: linear-gradient(120deg, var(--primary), var(--primary-deep));
  box-shadow: 0 12px 24px rgba(255, 47, 127, 0.34);
}

.btn.ghost {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.float-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.float-stars span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  transform: rotate(45deg);
  background: rgba(255, 77, 157, 0.75);
  box-shadow: 0 0 14px rgba(255, 77, 157, 0.45);
  animation: bob 4s ease-in-out infinite;
}

.float-stars span:nth-child(1) { top: 20%; left: 12%; }
.float-stars span:nth-child(2) { top: 16%; right: 14%; animation-delay: 0.9s; background: rgba(52, 199, 245, 0.82); }
.float-stars span:nth-child(3) { bottom: 21%; left: 20%; animation-delay: 1.6s; }
.float-stars span:nth-child(4) { bottom: 16%; right: 20%; animation-delay: 2.3s; background: rgba(101, 227, 210, 0.85); }

@keyframes bob {
  0%,100% { transform: translateY(0) rotate(45deg) scale(1); }
  50% { transform: translateY(-10px) rotate(45deg) scale(1.1); }
}

.story-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(170px, 34vw) minmax(250px, 420px) minmax(170px, 34vw);
  align-items: center;
  min-height: 360px;
  column-gap: clamp(0px, 0.5vw, 8px);
  margin: 0.8rem 0 1rem;
  position: relative;
}

#story-list .story-row + .story-row {
  margin-top: 2.2rem;
}

#story-list .story-row + .story-row::before {
  content: "";
  position: absolute;
  top: -1.3rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 60vw);
  height: 1px;
  background: var(--section-separator);
}

.story-row.left .story-media {
  grid-column: 1;
  justify-self: start;
  margin-left: clamp(14px, 2.4vw, 34px);
}

.story-row.left .story-copy {
  grid-column: 2;
  text-align: left;
  justify-self: start;
  margin-left: -52px;
}

.story-row.right .story-media {
  grid-column: 3;
  justify-self: end;
  margin-right: clamp(-34px, -2.5vw, -10px);
}

.story-row.right .story-copy {
  grid-column: 2;
  text-align: left;
  justify-self: end;
  margin-right: -93px;
}

.story-media {
  width: min(100%, 420px);
  aspect-ratio: 4 / 3;
  border-radius: 24px;
  border: 2px solid var(--line);
  box-shadow: 0 22px 42px rgba(86, 59, 148, 0.23);
  background-size: cover;
  background-position: center;
}

.media-about {
  background-image:
    radial-gradient(circle at 20% 25%, rgba(255, 112, 171, 0.55), transparent 35%),
    linear-gradient(140deg, #ffe0f1, #dff4ff);
}

.media-stack {
  background-image:
    linear-gradient(120deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0)),
    linear-gradient(140deg, #e8e2ff, #d8fcf2);
}

.media-hobby {
  background-image:
    radial-gradient(circle at 80% 78%, rgba(129, 198, 255, 0.5), transparent 38%),
    linear-gradient(140deg, #ffe7d2, #e4e9ff);
}

.media-contact {
  background-image:
    linear-gradient(130deg, #d9ecff, #ffe1f2);
}

.story-copy {
  max-width: 420px;
  padding: 0.4rem 0.2rem;
}

.story-copy h2 {
  font-family: "ZCOOL KuaiLe", cursive;
  font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  color: #4d2f88;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.88);
}

html[data-theme="dark"] .story-copy h2 {
  color: #d9ccff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

.story-copy p {
  margin-top: 0.58rem;
  margin-bottom: 0;
  color: var(--soft-ink);
  line-height: 1.8;
  font-size: 1.06rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .story-copy p {
  text-shadow: none;
}

.story-copy ul {
  margin: 0.8rem 0 0;
  padding-left: 1.15rem;
  color: var(--soft-ink);
}

.story-copy li + li {
  margin-top: 0.22rem;
}

.inline-actions {
  margin-top: 1.35rem;
}

.sns-links {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1rem;
  font-size: 0.96rem;
}

.sns-links-title {
  color: var(--soft-ink);
  font-weight: 700;
}

.sns-links-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1rem;
}

.sns-links a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.sns-links a:hover {
  color: #ff2f7f;
  border-color: rgba(255, 47, 127, 0.45);
}

.sns-tooltip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  max-width: min(82vw, 360px);
  padding: 0.45rem 0.62rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 10px 24px rgba(83, 55, 140, 0.2);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.3;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.sns-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sns-tip-icon {
  font-size: 1rem;
}

.sns-tip-text {
  word-break: break-all;
}

.site-footer {
  text-align: center;
  padding: 2.2rem 1rem 2.8rem;
  color: var(--footer-ink);
}

.footer-copy {
  display: block;
}

.friend-links {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1rem;
  font-size: 0.96rem;
}

.friend-links-title {
  color: var(--soft-ink);
  font-weight: 700;
}

.friend-links-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1rem;
}

.friend-links a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.friend-links a:hover {
  color: #ff2f7f;
  border-color: rgba(255, 47, 127, 0.45);
}

.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.from-left,
.from-right {
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0, 1);
}

.from-left { transform: translateX(-80px); }
.from-right { transform: translateX(80px); }

.reveal-item.is-visible .from-left,
.reveal-item.is-visible .from-right {
  opacity: 1;
  transform: translateX(0);
}

@media (max-width: 980px) {
  .story-row {
    grid-template-columns: minmax(140px, 30vw) minmax(220px, 400px) minmax(140px, 30vw);
  }
}

@media (max-width: 820px) {
  .theme-toggle {
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
  }

  .cover-title {
    font-size: clamp(1.9rem, 9vw, 3rem);
  }

  .story-row,
  .story-row.left,
  .story-row.right {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 1rem;
    padding: 0 1rem;
  }

  #story-list .story-row + .story-row {
    margin-top: 1.8rem;
  }

  #story-list .story-row + .story-row::before {
    width: min(320px, 75vw);
    top: -1rem;
  }

  .story-row.left .story-media,
  .story-row.right .story-media,
  .story-row.left .story-copy,
  .story-row.right .story-copy {
    grid-column: 1;
    margin: 0 auto;
    max-width: 520px;
    width: 100%;
  }

  .from-left,
  .from-right { transform: translateY(32px); }

  .reveal-item.is-visible .from-left,
  .reveal-item.is-visible .from-right { transform: translateY(0); }

  .hero {
    padding-top: 4rem;
  }

  .subtitle {
    font-size: 1rem;
  }
}
