:root {
  --wax-color: #8b1e2e;
  --gold: #c9a14a;
  --paper: #f4e8d0;
  --ink: #3a2a1a;
  --bg: #1a0f0a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--paper); font-family: 'STSong', 'SimSun', serif; min-height: 100vh; }

.envelope-stage {
  min-height: 100vh;
  display: grid; place-items: center;
  perspective: 1200px;
  padding: 24px;
}
.envelope {
  position: relative;
  width: min(86vw, 340px);
  aspect-ratio: 5 / 3;
  transform-style: preserve-3d;
  cursor: pointer;
}
.envelope-back {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #d4b896 0%, #c0a080 100%);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.envelope-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 60%;
  background: linear-gradient(180deg, #b89968 0%, #d4b896 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 600ms cubic-bezier(.5,0,.3,1);
}
.wax-seal {
  position: absolute; top: 45%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #c8334a, var(--wax-color));
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset -4px -4px 8px rgba(0,0,0,0.3);
  display: grid; place-items: center;
  font-family: serif; font-size: 1.1rem; color: var(--gold);
  z-index: 2;
  transition: transform 300ms;
}
.envelope-stage[data-stage="opening"] .wax-seal {
  transform: translate(-50%, -50%) scale(1.3);
  opacity: 0;
  transition: transform 300ms, opacity 300ms 200ms;
}
.envelope-stage[data-stage="opening"] .envelope-flap,
.envelope-stage[data-stage="open"] .envelope-flap {
  transform: rotateX(-180deg);
}
.letter {
  position: absolute; inset: 8% 6%;
  background: var(--paper); color: var(--ink);
  border-radius: 2px;
  padding: 20px 18px;
  font-size: 0.9rem; line-height: 1.8;
  transform: translateY(0); opacity: 0;
  transition: transform 800ms cubic-bezier(.2,.8,.2,1) 400ms, opacity 600ms 400ms;
}
.envelope-stage[data-stage="open"] .letter {
  transform: translateY(-50%);
  opacity: 1;
}
.envelope-hint { margin-top: 18px; font-size: 0.85rem; opacity: 0.7; text-align: center; }

/* ──────────── 地址卡 ──────────── */
.address-card {
  max-width: min(86vw, 380px);
  margin: 32px auto 24px;
  padding: 20px 18px;
  background: rgba(244, 232, 208, 0.06);
  border: 1px solid rgba(201, 161, 74, 0.3);
  border-radius: 6px;
  color: var(--paper);
  text-align: center;
}
.address-card-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 8px;
}
.address-card-name {
  font-size: 1.05rem;
  font-weight: normal;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}
.address-card-addr {
  font-size: 0.82rem;
  opacity: 0.78;
  line-height: 1.6;
  margin-bottom: 14px;
}
.address-card-map {
  height: 120px;
  border-radius: 4px;
  margin-bottom: 14px;
  background-color: #2a1a10;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(201, 161, 74, 0.18);
}
.address-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 380px) {
  .address-card-actions { grid-template-columns: repeat(3, 1fr); }
}
.btn {
  display: inline-block;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  border-radius: 3px;
  cursor: pointer;
  transition: opacity 200ms, transform 200ms;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--wax-color);
  color: var(--paper);
  border: 1px solid var(--wax-color);
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn:hover { opacity: 0.85; }

/* ──────────── Toast ──────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: var(--paper);
  padding: 10px 18px;
  font-size: 0.85rem;
  border-radius: 4px;
  z-index: 9999;
  animation: toast-in 200ms ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ──────────── CTA · LoveDiary ──────────── */
.cta-love-diary {
  display: block;
  max-width: min(86vw, 380px);
  margin: 18px auto 40px;
  padding: 14px 16px;
  text-align: center;
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--gold);
  border: 1px dashed var(--gold);
  border-radius: 4px;
  letter-spacing: 0.1em;
  transition: background 200ms;
}
.cta-love-diary:hover { background: rgba(201, 161, 74, 0.08); }

/* ──────────── 404 情话页 ──────────── */
.page-404 main {
  text-align: center;
  padding: 5rem 1.5rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}
.page-404 h1 {
  font-size: 2.4rem;
  margin-bottom: 1rem;
  color: var(--gold, #c9a14a);
  letter-spacing: 0.05em;
}
.page-404 p { margin-bottom: 0.75rem; }
.page-404 .muted { color: #999; margin-bottom: 2rem; font-size: 0.95rem; }

/* ──────────── /source 伪 git log ──────────── */
.page-source {
  background: #0a0e14;
  color: #b3b1ad;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
}
.terminal {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 60px;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal .prompt { color: #7ee787; margin: 0.4rem 0 0.8rem; }
.terminal .cursor {
  display: inline-block;
  animation: cursor-blink 1.1s steps(2) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }
.terminal .commit {
  margin: 0 0 1.6rem;
  padding-left: 0;
}
.terminal .commit header { color: #d4a72c; margin-bottom: 0.2rem; }
.terminal .commit .hash { color: #d4a72c; }
.terminal .commit .tag { color: #79c0ff; }
.terminal .commit .meta {
  color: #9aa5b1;
  white-space: pre;
  margin: 0.2rem 0;
}
.terminal .commit .message {
  color: #e6e1cf;
  margin: 0.5rem 0;
}
.terminal .commit .diff {
  color: #7ee787;
  background: rgba(126, 231, 135, 0.06);
  border-left: 3px solid #2d4f1e;
  padding: 0.4rem 0.8rem;
  margin: 0.4rem 0 0;
  white-space: pre;
  overflow-x: auto;
}

/* ──────────── Footer + 像素头像 + Deploy 倒计时 ──────────── */
.site-footer {
  max-width: 480px;
  margin: 2.5rem auto 1.5rem;
  padding: 1.5rem 1rem 2rem;
  text-align: center;
  border-top: 1px dashed rgba(201, 161, 74, 0.3);
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.6;
}
.pixel-avatar {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1;
  color: var(--gold, #c9a14a);
  letter-spacing: -1px;
  white-space: pre;
}
.footer-sign { margin: 0.6rem 0 0.3rem; }
.footer-hash {
  color: var(--gold, #c9a14a);
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  margin: 0.3rem 0 1rem;
}

.deploy-status {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.78rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid rgba(201, 161, 74, 0.25);
  border-radius: 3px;
  margin: 0.6rem 0;
}
.deploy-status .ds-label { color: #666; }
.deploy-status .ds-value { color: var(--gold, #c9a14a); font-weight: bold; letter-spacing: 0.1em; }
.deploy-status[data-status="live"] .ds-value { color: #e74c3c; animation: pulse 1.6s ease-in-out infinite; }
.deploy-status[data-status="deployed"] .ds-value { color: #7ee787; }
.deploy-status .ds-detail { color: #777; }
@keyframes pulse { 50% { opacity: 0.55; } }

.github-card {
  display: block;
  max-width: 360px;
  margin: 1.2rem auto 0;
  padding: 0.7rem 0.9rem;
  text-align: left;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  background: #fafafa;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.78rem;
  color: #444;
  line-height: 1.45;
}
.github-card-header { display: flex; gap: 0.4rem; align-items: center; }
.github-card-icon { color: #888; }
.github-card-repo { color: #0366d6; font-weight: 600; }
.github-card-private {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid #d1d5da;
  border-radius: 10px;
  color: #6a737d;
  font-size: 0.7rem;
}
.github-card-desc { margin: 0.5rem 0 0.5rem; color: #555; }
.github-card-meta { display: flex; gap: 0.9rem; color: #6a737d; font-size: 0.72rem; }

/* Konami 占位页 */
.page-konami main {
  text-align: center;
  padding: 5rem 1.5rem;
  max-width: 480px;
  margin: 0 auto;
}
.page-konami h1 {
  font-size: 2.4rem;
  margin-bottom: 1rem;
  color: var(--gold, #c9a14a);
}
.page-konami .muted {
  color: #999;
  font-size: 0.85rem;
  font-family: 'Menlo', 'Consolas', monospace;
  margin: 1rem 0 2rem;
}

/* ──────────── 站点欢迎页(根 /) ──────────── */
.page-home {
  background: #faf6ee;
  min-height: 100vh;
  margin: 0;
}
.home-stage {
  max-width: 460px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
}
.page-home .pixel-avatar {
  margin: 0 auto 1.5rem;
  display: block;
  text-align: left;
  font-size: 16px;
}
.home-monogram {
  font-family: 'Cormorant Garamond', 'Times New Roman', serif;
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--gold, #c9a14a);
  margin: 0.3rem 0 0.6rem;
}
.home-couple {
  font-size: 1.35rem;
  letter-spacing: 0.15em;
  color: #3a342b;
  margin: 0.3rem 0 1.2rem;
}
.home-divider {
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 0.85rem;
  color: #b89b5e;
  letter-spacing: 0.1em;
  margin: 0.6rem 0 0.4rem;
}
.home-venue {
  font-size: 0.92rem;
  color: #6a5d47;
  margin: 0.2rem 0 2.4rem;
  letter-spacing: 0.05em;
}
.home-prompt {
  font-size: 1rem;
  color: #4a4136;
  line-height: 1.8;
  padding: 1.4rem 1.2rem;
  border-top: 1px dashed rgba(201, 161, 74, 0.35);
  border-bottom: 1px dashed rgba(201, 161, 74, 0.35);
  margin: 0 0 1.8rem;
  letter-spacing: 0.05em;
}
.home-prompt-sub {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: #998d76;
  letter-spacing: 0.05em;
}
.page-home .deploy-status {
  margin-top: 0.6rem;
}
