:root {
  --night-0: #141820;
  --night-1: #1c2330;
  --night-2: #2a3140;
  --cream: #ece6d9;
  --cream-deep: #e3dccb;
  --paper: #f7f3ea;
  --gold: #c5ab85;
  --gold-soft: rgba(197, 171, 133, 0.72);
  --ink: #2c323f;
  --ink-soft: rgba(44, 50, 63, 0.58);
  --clay: #c88f7a;
  --clay-deep: #b67c68;
  --line: rgba(44, 50, 63, 0.08);
  --shadow: 0 18px 40px rgba(20, 24, 32, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  font-family: "Noto Serif SC", "Songti SC", serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 20% 10%, #2a3142 0%, transparent 45%),
    radial-gradient(ellipse at 80% 90%, #1a1f2a 0%, transparent 40%),
    #0e1117;
  overflow-x: hidden;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 32px 24px;
}

.phone {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 42px;
  overflow: hidden;
  background: var(--night-0);
  box-shadow:
    0 0 0 10px #0a0c10,
    0 0 0 12px #2b303b,
    0 40px 80px rgba(0, 0, 0, 0.45);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 28px;
  border-radius: 20px;
  background: #050608;
  z-index: 20;
}

.page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sky {
  position: relative;
  flex: 0 0 34%;
  min-height: 240px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 78% 18%, rgba(120, 140, 180, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 18% 70%, rgba(90, 100, 130, 0.14), transparent 60%),
    linear-gradient(180deg, #12161e 0%, #1a2130 55%, #243044 100%);
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.sky-haze {
  position: absolute;
  inset: -10%;
  z-index: 2;
  background:
    radial-gradient(circle at 70% 20%, rgba(210, 190, 150, 0.08), transparent 28%),
    radial-gradient(circle at 30% 60%, rgba(160, 175, 210, 0.07), transparent 35%);
  animation: hazeDrift 18s ease-in-out infinite alternate;
  pointer-events: none;
}

.sky-drift {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.03) 48%, transparent 62%);
  background-size: 220% 220%;
  animation: veilSweep 14s linear infinite;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

.moon-wrap {
  position: absolute;
  top: 48px;
  right: 34px;
  width: 72px;
  height: 72px;
  z-index: 3;
  transform: translate3d(0, 0, 0);
  transition: transform 0.45s ease-out;
  pointer-events: none;
}

.moon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(236, 230, 217, 0.18);
}

.ring-a {
  inset: -10px;
  animation: ringPulse 6.5s ease-in-out infinite;
}

.ring-b {
  inset: -24px;
  border-color: rgba(236, 230, 217, 0.1);
  animation: ringPulse 6.5s ease-in-out infinite 0.8s;
}

.moon-glow {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 230, 217, 0.22), transparent 68%);
  animation: moonBreath 5.2s ease-in-out infinite;
}

.moon {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset -16px 0 0 0 #ece6d9;
  filter: drop-shadow(0 0 10px rgba(236, 230, 217, 0.35));
}

.shooting-star {
  position: absolute;
  top: 18%;
  left: -20%;
  width: 110px;
  height: 1.5px;
  z-index: 4;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), #c5ab85);
  border-radius: 2px;
  opacity: 0;
  transform: rotate(-28deg);
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.55));
}

.shooting-star.is-active {
  animation: shoot 1.15s ease-out forwards;
}

.sky-copy {
  position: absolute;
  left: 28px;
  top: 58px;
  bottom: auto;
  z-index: 5;
  max-width: 230px;
  color: #f3efe6;
  transform: translate3d(0, 0, 0);
  transition: transform 0.45s ease-out;
}

.sky-label {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--gold);
  margin-bottom: 10px;
  opacity: 0;
  animation: riseIn 1s ease 0.2s forwards;
}

.sky-brand {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0.18em;
  line-height: 1;
  margin-bottom: 14px;
  color: #f7f1e5;
  text-shadow: 0 0 24px rgba(197, 171, 133, 0.25);
  opacity: 0;
  animation: riseIn 1.1s ease 0.35s forwards;
}

.sky-tag {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(243, 239, 230, 0.78);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: riseIn 1.1s ease 0.55s forwards;
}

.sky-tag.soft {
  color: rgba(243, 239, 230, 0.55);
  animation-delay: 0.7s;
}

.sky-tap-hint {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: auto;
  transform: none;
  z-index: 6;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(236, 230, 217, 0.35);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  opacity: 0;
  animation: fadePulse 3.5s ease-in-out 1.4s infinite;
}

.sheet {
  position: relative;
  flex: 1;
  min-height: 0;
  background: linear-gradient(180deg, var(--cream) 0%, #e8e1d2 100%);
  border-radius: 0;
  margin-top: 0;
  padding: 22px 22px 14px;
  z-index: 10;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: auto;
  animation: sheetUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.quote-card {
  background: var(--paper);
  border-radius: 18px;
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.55);
  transform-origin: center top;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.quote-card:active {
  transform: scale(0.985);
}

.quote-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.seal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #f7f1e5;
  background: linear-gradient(145deg, #d0b790, #b8976d);
  box-shadow: 0 4px 12px rgba(184, 151, 109, 0.35);
}

.quote-label {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.08em;
}

.quote-text {
  font-size: 20px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-weight: 500;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.meta-card {
  text-align: left;
  background: rgba(247, 243, 234, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.meta-card:hover,
.meta-card:focus-visible {
  background: #f8f4eb;
  border-color: rgba(197, 171, 133, 0.35);
}

.meta-card:active {
  transform: scale(0.97);
}

.meta-k {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.meta-v {
  display: block;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.06em;
}

.entries {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 18px;
  padding: 18px 16px;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.entry:active {
  transform: scale(0.98);
}

.entry-title {
  display: block;
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 1.35;
  font-weight: 500;
}

.entry-sub {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  opacity: 0.72;
}

.entry-shake {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 30%, rgba(197, 171, 133, 0.14), transparent 28%),
    linear-gradient(135deg, #252f3f 0%, #1c2432 100%);
  color: #f3efe6;
}

.shake-deco {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
}

.shake-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px solid rgba(197, 171, 133, 0.7);
  display: grid;
  place-items: center;
}

.shake-star {
  width: 10px;
  height: 10px;
  background: #c5ab85;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  filter: drop-shadow(0 0 6px rgba(197, 171, 133, 0.55));
  animation: starPulse 2.8s ease-in-out infinite;
}

.shake-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(197, 171, 133, 0.75);
}

.shake-dot.d1 { top: 4px; right: 8px; }
.shake-dot.d2 { bottom: 8px; left: 2px; width: 2px; height: 2px; opacity: 0.55; }
.shake-dot.d3 { top: 18px; right: 0; width: 2px; height: 2px; opacity: 0.45; }

.entry-shake .entry-title {
  color: #f0e6d4;
  font-size: 15px;
}

.entry-shake .entry-sub {
  color: rgba(236, 230, 217, 0.62);
  opacity: 1;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.entry-chat {
  min-height: 92px;
  background: #d8a08c;
  color: var(--ink);
}

.entry-chat .entry-title {
  color: #3a2f2b;
}

.entry-chat .entry-sub {
  color: rgba(58, 47, 43, 0.62);
  opacity: 1;
}

.entry-ask {
  min-height: 92px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.entry-ask .entry-sub {
  color: var(--ink-soft);
  opacity: 1;
}

.entry-shake.is-shaking {
  animation: cardShake 0.55s ease;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-0.4deg); }
  40% { transform: translateX(4px) rotate(0.4deg); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

.footer-line {
  margin-top: auto;
  padding-top: 12px;
  padding-bottom: 4px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(44, 50, 63, 0.35);
}

.tabbar {
  flex: 0 0 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  background: #f4efe4;
  border-top: 1px solid rgba(44, 50, 63, 0.06);
  padding: 6px 8px 10px;
  z-index: 25;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  border-radius: 12px;
  color: rgba(44, 50, 63, 0.38);
  transition: background 0.2s ease, color 0.2s ease;
}

.tab:active {
  background: rgba(44, 50, 63, 0.04);
}

.tab.is-active {
  color: var(--ink);
}

.tab-icon.home {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(182, 124, 104, 0.18);
}

.tab-placeholder {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px dashed rgba(44, 50, 63, 0.2);
}

.tab-label {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.tab-label.muted {
  color: rgba(44, 50, 63, 0.28);
  letter-spacing: 0.12em;
}

.tab.is-active .tab-label {
  color: var(--clay-deep);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 12px);
  z-index: 30;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(28, 35, 48, 0.88);
  color: #f3efe6;
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.notes {
  width: min(340px, 100%);
  color: rgba(236, 230, 217, 0.86);
}

.notes h2 {
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  color: #f7f1e5;
}

.notes p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(236, 230, 217, 0.62);
  margin-bottom: 16px;
}

.notes ul {
  list-style: none;
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.notes li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(236, 230, 217, 0.72);
}

.notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.7;
}

.notes .path {
  font-size: 12px;
  color: rgba(197, 171, 133, 0.7);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheetUp {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

@keyframes moonBreath {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.06); }
}

@keyframes ringPulse {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}

@keyframes hazeDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.05); }
}

@keyframes veilSweep {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(-28deg) scaleX(0.2); }
  12% { opacity: 1; }
  100% { opacity: 0; transform: translate(280px, 150px) rotate(-28deg) scaleX(1); }
}

@keyframes shine {
  0%, 70%, 100% { transform: translateX(-120%); }
  85% { transform: translateX(120%); }
}

@keyframes fadePulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}

@media (max-width: 900px) {
  .stage {
    flex-direction: column;
    padding: 16px;
  }

  .notes {
    order: -1;
    width: min(390px, 100%);
  }
}

@media (max-width: 430px) {
  body {
    background: #0e1117;
  }

  .stage {
    padding: 0;
    min-height: 100dvh;
  }

  .phone {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }

  .phone-notch {
    display: none;
  }

  .notes {
    display: none;
  }

  .sky {
    flex-basis: 32%;
    min-height: 220px;
  }

  .sky-copy {
    top: 48px;
  }

  .tabbar {
    flex-basis: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}
