/* 月下小庭院：雾绿夜色与暖纸签笺。 */
/* 安全区及页面外沿也铺上夜色；关闭庭院后恢复原来的纸色。 */
html.moon-world-active,
html.moon-world-active body {
  background: #82988e;
}
/* 避免系统从底层米白导航栏取色；关闭庭院时自动恢复。 */
html.moon-world-active #shell { visibility: hidden; }
#moon-world {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #30493f;
  background: #82988e;
}
#moon-world::backdrop { background: #82988e; }
/* 柔光收在中部，状态栏与手势栏边缘始终保持同一底色。 */
#moon-world::before {
  content: "";
  position: fixed;
  inset: calc(80px + env(safe-area-inset-top, 0px)) 0 calc(70px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at center, rgba(239,235,203,.6), transparent 70%);
  pointer-events: none;
}
.moon-world-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  min-height: 100%;
  margin: auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 26px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
}
#moon-world[open] .moon-world-inner { animation: moon-world-enter 550ms ease-out both; }
.moon-world-top { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; }
#moon-world-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #263f35;
  font: 12px var(--serif);
  cursor: pointer;
}
#moon-world-date { font: 11px var(--serif); color: #30493f; }
#moon-world button:focus-visible { outline: 1px solid #355143; outline-offset: 5px; }
.moon-world-intro { text-align: center; margin-top: clamp(18px, 5vh, 48px); }
.moon-world-halo {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250,240,208,.25) 30%, rgba(250,240,208,.09) 62%, transparent 72%);
  box-shadow: 0 0 56px 16px rgba(244,236,204,.10);
}
#moon-world-phase { --sage: #fff2d3; width: 82px; height: 82px; filter: drop-shadow(0 0 12px rgba(255,242,211,.22)); }
#moon-world-title { font-size: 29px; font-weight: 400; letter-spacing: .22em; padding-left: .22em; }
.moon-world-reading { width: 100%; max-width: 330px; margin: 30px auto 0; text-align: center; }
#moon-draw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0 50px;
  padding: 15px 23px;
  border: 1px solid rgba(250,246,230,.65);
  border-radius: 28px;
  background: rgba(250,246,230,.6);
  color: #3e5b48;
  box-shadow: 0 8px 28px rgba(62,91,72,.06);
  font: 15px var(--serif);
  letter-spacing: .08em;
  cursor: pointer;
}
#moon-draw:hover { background: rgba(250,246,230,.85); }
#moon-sign {
  padding: 26px 22px 19px;
  border: 1px solid rgba(255,250,237,.8);
  border-radius: 90px 90px 20px 20px / 22px 22px 20px 20px;
  background: #f7f2e6;
  box-shadow: 0 12px 38px rgba(54,78,62,.08);
}
#moon-sign.unfolding { animation: moon-sign-unfold 650ms cubic-bezier(.2,.7,.2,1) both; transform-origin: top center; }
.moon-sign-kicker { font: 9px var(--sans); color: #7f8875; }
#moon-sign-title { font-weight: 400; font-size: 22px; letter-spacing: .16em; margin: 14px 0 18px; }
#moon-sign-words { white-space: pre-line; font-size: 16px; line-height: 2; color: #3c5144; }
#moon-sign-note { margin-top: 18px; font-size: 11px; line-height: 1.9; color: #727a69; }
.moon-sign-sprig { width: 46px; height: 20px; margin-top: 18px; fill: none; stroke: #9eac91; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.moon-world-foot { margin-top: auto; padding-top: 34px; font-size: 10px; letter-spacing: .18em; color: #526a58; }
.moon-world-landscape {
  position: fixed; bottom: 0; left: 0; width: 100%; height: 38vh; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent calc(100% - env(safe-area-inset-bottom, 0px)));
  mask-image: linear-gradient(to bottom, #000 45%, transparent calc(100% - env(safe-area-inset-bottom, 0px)));
}
@keyframes moon-world-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes moon-sign-unfold { from { opacity: 0; transform: translateY(-8px) scaleY(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #moon-world[open] .moon-world-inner, #moon-sign.unfolding { animation: none; }
}
