/* ============================================================
   庭院 · 应用外壳
   手机优先（iPhone 竖屏）。桌面端自动扩展成更大的庭院空间：
   左侧出现月相观测台与空间长廊，右侧是庭院本体。
   ============================================================ */

.frame {
  position: relative;
  z-index: var(--z-shell);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 34px;
  padding: 0;
}

/* ── 庭院本体（就是你的世界本体） ── */
.shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  /* 夜雾：顶部留一层薄透明，让月亮与枝叶透出来 */
  background: linear-gradient(
    180deg,
    rgba(8, 11, 19, 0.08) 0px,
    rgba(8, 11, 19, 0.34) 130px,
    rgba(8, 11, 19, 0.72) 250px,
    rgba(8, 11, 19, 0.90) 400px,
    rgba(8, 11, 19, 0.93) calc(100% - 132px),
    rgba(8, 11, 19, 0.80) 100%
  );
}

@media (min-width: 641px) {
  .frame { padding: 26px 0; align-items: center; }
  .shell {
    max-width: var(--shell-w);
    height: min(940px, calc(100dvh - 52px));
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: linear-gradient(
      180deg,
      rgba(9, 12, 20, 0.34) 0px,
      rgba(9, 12, 20, 0.70) 150px,
      rgba(9, 12, 20, 0.89) 320px,
      rgba(9, 12, 20, 0.92) calc(100% - 120px),
      rgba(9, 12, 20, 0.84) 100%
    );
    backdrop-filter: blur(16px) saturate(115%);
    -webkit-backdrop-filter: blur(16px) saturate(115%);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.045) inset,
      0 40px 90px -50px rgba(0, 0, 0, 0.95);
    overflow: hidden;
  }
}

/* ── 顶栏 ────────────────────────────────────────────────── */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: calc(var(--safe-t) + 22px) var(--s5) var(--s3);
}
@media (min-width: 641px) {
  .topbar { padding: 22px var(--s5) var(--s3); }
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-serif);
  font-size: var(--t-lg);
  letter-spacing: 0.30em;
  color: var(--moon-100);
  font-weight: 400;
}
.wordmark__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--c-glimmer);
  box-shadow: 0 0 12px rgba(226, 189, 124, 0.75);
  transform: translateY(-2px);
}

.topbar__right { display: flex; align-items: center; gap: var(--s2); }

.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--s-1);
  font-size: var(--t-sm);
  color: var(--moon-200);
  transition: border-color var(--e2) var(--ease), background var(--e2) var(--ease);
}
.phase-chip:hover { border-color: var(--line-2); background: var(--s-2); }
.phase-chip svg { width: 17px; height: 17px; flex: none; }
.phase-chip__sub { color: var(--moon-400); }

/* ── 视图滚动区 ──────────────────────────────────────────── */
.view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 26px var(--s5) var(--s7);
}
.view.is-enter { animation: riseIn var(--e3) var(--ease-out) both; }
.view::-webkit-scrollbar { width: 0; }

/* ── 底部导航：五个入口，不多 ────────────────────────────── */
.nav {
  flex: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: var(--s2) var(--s3) calc(var(--safe-b) + 10px);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 11, 19, 0) 0%, rgba(7, 9, 16, 0.72) 40%, rgba(6, 8, 14, 0.92) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 9px 2px 7px;
  border-radius: var(--r-md);
  color: var(--moon-400);
  transition: color var(--e2) var(--ease), background var(--e2) var(--ease);
}
.nav__item svg { width: 21px; height: 21px; stroke: currentColor; }
.nav__item span { font-size: var(--t-xs); letter-spacing: 0.14em; }
.nav__item:active { background: var(--s-1); }
.nav__item.is-on { color: var(--moon-100); }
.nav__item.is-on svg { filter: drop-shadow(0 0 9px rgba(226, 189, 124, 0.34)); }
.nav__item.is-on .nav__dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--c-glimmer);
  box-shadow: 0 0 8px rgba(226, 189, 124, 0.8);
  position: absolute;
  transform: translateY(19px);
}
.nav__item { position: relative; }

/* ── 桌面端：左侧月相观测台 + 空间长廊 ───────────────────── */
.aside {
  display: none;
  flex: none;
  width: var(--aside-w);
  align-self: center;
  height: min(940px, calc(100dvh - 52px));
  flex-direction: column;
  gap: var(--s5);
  animation: riseIn var(--e3) var(--ease-out) 120ms both;
}
@media (min-width: 1024px) {
  .aside { display: flex; }
}

.observatory {
  padding: var(--s5);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 26, 44, 0.5), rgba(10, 13, 22, 0.66));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}
.observatory::after {
  content: "";
  position: absolute;
  inset: -40% -60% auto auto;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(226,189,124,0.10), transparent 68%);
  pointer-events: none;
}
.observatory__moon { width: 62px; height: 62px; margin-bottom: var(--s4); }
.observatory__phase {
  font-family: var(--font-serif);
  font-size: var(--t-md);
  color: var(--moon-100);
  letter-spacing: 0.08em;
}
.observatory__illum { font-size: var(--t-sm); color: var(--moon-400); margin-top: 2px; }
.observatory__clock {
  margin-top: var(--s4);
  font-size: var(--t-2xl);
  color: var(--moon-100);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.observatory__clock small { font-size: var(--t-md); color: var(--moon-400); letter-spacing: 0.06em; }
.observatory__date { font-size: var(--t-sm); color: var(--moon-300); margin-top: 2px; }
.observatory__day {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: var(--t-sm);
  color: var(--moon-300);
  display: flex;
  justify-content: space-between;
}
.observatory__day b { color: var(--moon-100); font-weight: 400; }

.rail { display: flex; flex-direction: column; gap: 1px; }
.rail__head {
  font-size: var(--t-xs);
  letter-spacing: 0.22em;
  color: var(--moon-400);
  margin-bottom: var(--s2);
}
.rail__item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--moon-300);
  font-size: var(--t-sm);
  transition: background var(--e2) var(--ease), color var(--e2) var(--ease);
  text-align: left;
  width: 100%;
}
.rail__item:hover { background: var(--s-1); color: var(--moon-100); }
.rail__item i {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--dot, var(--moon-400));
  box-shadow: 0 0 10px -1px var(--dot, transparent);
}
.rail__item.is-unlit { opacity: 0.42; }
.rail__item em { font-style: normal; margin-left: auto; font-size: var(--t-xs); color: var(--moon-400); }
