:root {
  --blue: #c8e0f4;
  --pink: #f5e0e8;
  --ink: #171f26;
  --ink-2: #35434f;
  --ink-3: #5b6a76;
  --hi: rgba(255, 255, 255, 0.92);
  --lo: rgba(23, 31, 38, 0.13);
  --sh: -6px -6px 16px var(--hi), 8px 9px 22px var(--lo);
  --sh-sm: -3px -3px 8px var(--hi), 4px 5px 12px var(--lo);
  --sh-in: inset 3px 3px 9px rgba(23, 31, 38, 0.1), inset -3px -3px 9px rgba(255, 255, 255, 0.92);
  --r: 28px;
  --rail: 84px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: #e9f1f8;
}

html.menu-open {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 400 17px/1.78 "EB Garamond", "Crimson Text", Georgia, "Songti SC", "Noto Serif SC", serif;
  background:
    radial-gradient(58vw 58vw at 88% -8%, #fbe9f1 0%, rgba(251, 233, 241, 0) 68%),
    radial-gradient(52vw 52vw at -6% 96%, #d6e7f7 0%, rgba(214, 231, 247, 0) 66%),
    linear-gradient(165deg, #e7f0f9 0%, #f8ecf2 100%);
  background-attachment: fixed;
}

a {
  color: #1d2c37;
}

img {
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 3px solid #7ba7c9;
  outline-offset: 3px;
  border-radius: 10px;
}

/* 左侧固定竖栏 */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 22px 0 26px;
  background: linear-gradient(180deg, #dcebf7 0%, #f6e7ee 100%);
  box-shadow: 8px 0 26px rgba(23, 31, 38, 0.08);
}

.brand {
  width: 100%;
  padding: 8px 6px;
  text-align: center;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.16em;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.burger {
  order: 2;
  margin-top: auto;
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  background: linear-gradient(145deg, #fdf7fa, #e4d2dc);
  box-shadow: var(--sh-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.burger:active {
  transform: scale(0.94);
  box-shadow: var(--sh-in);
}

.burger-bar {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
}

.rail-contact {
  order: 3;
  margin-top: 4px;
  padding: 13px 10px;
  border-radius: 14px;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink-2);
  background: linear-gradient(145deg, #f3f8fc, #d3e4f3);
  box-shadow: var(--sh-sm);
}

/* 全屏遮罩菜单 */
.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  background: radial-gradient(70vw 70vw at 30% 20%, #f8e8f0 0%, #dfeefb 60%, #d3e6f6 100%);
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu.is-open {
  opacity: 1;
  visibility: visible;
}

.menu-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(520px, 100%);
}

.menu-link {
  padding: 15px 26px;
  border-radius: 20px;
  font-size: 21px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(145deg, #fdf7fa, #ead9e2);
  box-shadow: var(--sh-sm);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.34s ease, opacity 0.34s ease;
}

.menu.is-open .menu-link {
  transform: translateY(0);
  opacity: 1;
}

.menu.is-open .menu-link:nth-child(2) { transition-delay: 0.03s; }
.menu.is-open .menu-link:nth-child(3) { transition-delay: 0.06s; }
.menu.is-open .menu-link:nth-child(4) { transition-delay: 0.09s; }
.menu.is-open .menu-link:nth-child(5) { transition-delay: 0.12s; }
.menu.is-open .menu-link:nth-child(6) { transition-delay: 0.15s; }
.menu.is-open .menu-link:nth-child(7) { transition-delay: 0.18s; }

/* 首屏 */
main {
  margin-left: var(--rail);
}

.hero {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  min-height: 70vh;
  padding: 64px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

.badge {
  margin: 0;
  padding: 9px 22px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: #3f4d59;
  background: linear-gradient(145deg, #fbeef4, #e3ced9);
  box-shadow: var(--sh-sm);
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6.2vw, 56px);
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-desc {
  margin: 0;
  max-width: 36em;
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink-2);
}

.hero-art {
  position: absolute;
  top: calc(13% + var(--py, 0px));
  right: 3%;
  width: 104px;
  height: 104px;
  margin: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #fdf5f9, #e6cfd9);
  box-shadow: -8px -8px 20px rgba(255, 255, 255, 0.92), 10px 12px 26px rgba(23, 31, 38, 0.14);
  animation: bob 7s ease-in-out infinite;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orb {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, #cfe4f6, #a9c9e3);
  box-shadow: inset -4px -4px 10px rgba(255, 255, 255, 0.8), inset 5px 5px 12px rgba(23, 31, 38, 0.16);
}

@keyframes bob {
  50% { transform: translateY(-12px) rotate(-3deg); }
}

/* 正文与右栏 */
.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 84px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 34px;
  align-items: start;
}

.prose {
  padding: clamp(24px, 4vw, 46px);
  border-radius: var(--r);
  background: #fbf7f9;
  box-shadow: var(--sh-in);
  overflow-wrap: break-word;
}

.prose > div + div {
  margin-top: 42px;
  padding-top: 34px;
  border-top: 1px solid rgba(23, 31, 38, 0.09);
}

div[id] {
  scroll-margin-top: 96px;
}

.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.prose h3 {
  margin: 30px 0 10px;
  font-size: 20px;
  line-height: 1.45;
}

.prose p {
  margin: 0 0 16px;
  line-height: 1.9;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.4em;
}

.prose li {
  margin-bottom: 8px;
  line-height: 1.85;
}

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose strong {
  font-weight: 700;
}

.prose blockquote {
  margin: 22px 0;
  padding: 18px 22px;
  border-radius: 20px;
  color: var(--ink-2);
  background: linear-gradient(145deg, #eff6fc, #dde9f4);
  box-shadow: var(--sh-sm);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose figure {
  margin: 24px 0;
}

.prose figcaption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--ink-3);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(23, 31, 38, 0.1);
}

.side {
  position: sticky;
  top: 96px;
  padding: 24px 20px;
  border-radius: var(--r);
  background: linear-gradient(145deg, #fcf4f8, #e7d6e0);
  box-shadow: var(--sh);
}

.side h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.1em;
}

.subtitle {
  margin: 5px 0 0;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.side-list {
  list-style: none;
  counter-reset: s;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}

.side-list li {
  counter-increment: s;
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.6;
  text-decoration: none;
  color: #22303b;
  transition: box-shadow 0.16s ease, background 0.16s ease;
}

.side-list a::before {
  content: counter(s, decimal-leading-zero);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #7b8b98;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: linear-gradient(145deg, #eff6fc, #dbe8f4);
  box-shadow: var(--sh-sm);
}

/* 页脚 */
.foot {
  margin-left: var(--rail);
  padding: 54px clamp(20px, 5vw, 48px) 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #e9dfe8 45%, #ded3de 100%);
}

.foot-mark {
  font-size: clamp(44px, 11vw, 116px);
  line-height: 0.94;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  color: #c0b0bc;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.foot-row {
  max-width: 1080px;
  margin: 26px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
}

.foot-logo {
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(145deg, #fdf7fa, #e6d5df);
  box-shadow: var(--sh-sm);
}

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  color: #26333d;
  transition: box-shadow 0.16s ease;
}

.foot-nav a:hover,
.foot-nav a:focus-visible {
  box-shadow: var(--sh-sm);
  background: linear-gradient(145deg, #f7fbfd, #dfeaf4);
}

.copy {
  margin: 0;
  font-size: 15px;
  color: #55636f;
}

@media (max-width: 860px) {
  .rail {
    inset: 0 0 auto 0;
    width: 100%;
    height: 68px;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    box-shadow: 0 8px 22px rgba(23, 31, 38, 0.1);
  }

  .brand {
    width: auto;
    writing-mode: horizontal-tb;
    font-size: 17px;
    letter-spacing: 0.08em;
    text-align: left;
    padding: 10px 4px;
  }

  .burger {
    order: 0;
    margin: 0 0 0 auto;
  }

  .rail-contact {
    order: 0;
    margin: 0;
    padding: 13px 14px;
  }

  main,
  .foot {
    margin-left: 0;
  }

  main {
    padding-top: 68px;
  }

  .hero {
    min-height: 58vh;
    padding: 44px 20px 40px;
    gap: 16px;
  }

  .hero-art {
    position: static;
    width: 84px;
    height: 84px;
    order: -1;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 0 16px 64px;
  }

  .side {
    position: static;
  }

  .menu-link {
    font-size: 19px;
    padding: 14px 20px;
  }

  .foot {
    padding: 40px 16px 32px;
  }

  .foot-row {
    justify-content: center;
    text-align: center;
  }

  .foot-nav dl {
    justify-content: center;
  }
}

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

  .hero-art {
    animation: none;
  }

  .menu,
  .menu-link,
  .burger {
    transition-duration: 0.01ms;
  }

  .menu-link {
    transform: none;
    opacity: 1;
  }
}

button[aria-expanded]{min-width:44px;min-height:44px}
