:root {
  color-scheme: dark;
  --night: #090d1d;
  --night-soft: #10162d;
  --panel: rgba(19, 25, 49, 0.7);
  --panel-strong: rgba(22, 29, 57, 0.92);
  --stroke: rgba(185, 194, 228, 0.14);
  --text: #f7f3f0;
  --muted: #a8b2ce;
  --purple: #9f8fda;
  --purple-deep: #6e5ba8;
  --blue: #8aa8c7;
  --gold: #e7bd73;
  --pink: #e4a7bb;
  --green: #83c9ae;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  --radius-lg: 28px;
  --radius-md: 20px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(111, 91, 168, 0.32), transparent 36rem),
    radial-gradient(circle at 92% 25%, rgba(83, 122, 162, 0.19), transparent 34rem),
    linear-gradient(160deg, #080b18 0%, #0c1125 45%, #090d1d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.7) 0 1px, transparent 1.4px),
    radial-gradient(circle at 75% 42%, rgba(255,255,255,.45) 0 1px, transparent 1.5px),
    radial-gradient(circle at 55% 78%, rgba(255,255,255,.45) 0 1px, transparent 1.5px);
  background-size: 140px 160px, 190px 210px, 230px 250px;
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -2;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  pointer-events: none;
}
.ambient-one { top: 18%; left: -22rem; background: var(--purple); }
.ambient-two { right: -20rem; bottom: -15rem; background: var(--blue); }

.topbar {
  width: min(1180px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231,189,115,.35);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(231,189,115,.12), 0 0 30px rgba(231,189,115,.08);
}
.brand-mark span { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 16px var(--gold); }
.brand strong { display: block; letter-spacing: .13em; font-size: .78rem; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: .78rem; letter-spacing: .18em; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.connection { color: var(--muted); font-size: .84rem; }
.connection i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(131,201,174,.8); }
.icon-button {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.03); cursor: pointer;
}
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.icon-button[aria-pressed="true"] { color: var(--gold); background: rgba(231,189,115,.1); }

main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.welcome {
  min-height: 510px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 64px;
  padding: 48px 0 36px;
}
.eyebrow, .panel-kicker, .dialog-kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.welcome h1 { margin: 0; font-family: "Songti SC", "Noto Serif SC", serif; font-size: clamp(2.8rem, 6vw, 5.7rem); font-weight: 500; line-height: 1.12; letter-spacing: -.04em; }
.welcome-note { max-width: 650px; margin: 28px 0 0; color: #bdc5db; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 1.08rem; line-height: 1.9; }
.welcome-actions { display: flex; align-items: center; gap: 18px; margin-top: 34px; }
.primary-button, .secondary-button, .text-button, .return-input button {
  border: 0;
  cursor: pointer;
}
.primary-button {
  min-width: 150px;
  padding: 14px 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  color: #161426;
  background: linear-gradient(135deg, #f0cf92, var(--gold));
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(231,189,115,.18);
}
.primary-button span { font-weight: 760; }
.primary-button small { font-size: .75rem; opacity: .64; }
.primary-button:active { transform: translateY(1px); }
.text-button { padding: 12px 5px; color: var(--muted); background: transparent; border-bottom: 1px solid rgba(168,178,206,.35); }
.text-button:hover { color: var(--text); border-color: var(--text); }

.light-stage { position: relative; min-height: 410px; display: grid; place-items: center; isolation: isolate; }
.light-stage::before {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(158,143,218,.14);
  border-radius: 50%;
  box-shadow: 0 0 100px rgba(111,91,168,.18), inset 0 0 80px rgba(111,91,168,.07);
}
.moon {
  position: relative;
  width: 196px;
  height: 196px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.moon-core {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3e7ff 0%, #bdade8 42%, #7763b3 72%, #3c315e 100%);
  box-shadow: 0 0 36px rgba(184,162,234,.55), 0 0 110px rgba(112,86,179,.4);
}
.moon-ring { position: absolute; inset: 4px; border: 1px solid rgba(191,173,232,.25); border-radius: 50%; }
.ring-one { animation: breathe 6s ease-in-out infinite; }
.ring-two { inset: -18px; opacity: .45; animation: breathe 6s 1.1s ease-in-out infinite; }
.little-light {
  position: absolute;
  right: 14%;
  bottom: 24%;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231,189,115,.28);
  border-radius: 50%;
  color: #272036;
  background: radial-gradient(circle at 35% 28%, #f5dda9, #d8a85e 72%);
  box-shadow: 0 12px 35px rgba(0,0,0,.34), 0 0 30px rgba(231,189,115,.2);
  cursor: pointer;
  transition: transform .2s ease;
}
.little-light:hover { transform: translateY(-3px) rotate(1deg); }
.cat-glyph { font-size: 2rem; line-height: 1; filter: saturate(.75) drop-shadow(0 5px 7px rgba(0,0,0,.2)); }
.cat-label { position: absolute; bottom: -23px; color: var(--muted); font-size: .72rem; letter-spacing: .16em; }
.orbit { position: absolute; font-size: 1.45rem; color: var(--gold); filter: drop-shadow(0 0 9px rgba(231,189,115,.4)); opacity: .7; transition: all 1.3s cubic-bezier(.2,.8,.2,1); }
.orbit-sun { left: 12%; top: 22%; }
.orbit-fish { right: 10%; top: 18%; color: var(--blue); font-size: 2rem; }
.light-stage.anniversary-on .orbit-sun { left: 42%; top: 34%; transform: scale(1.4) rotate(24deg); }
.light-stage.anniversary-on .orbit-fish { right: 37%; top: 48%; transform: scale(1.3) rotate(-8deg); }
.stage-caption { position: absolute; bottom: 4px; margin: 0; text-align: center; color: var(--text); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.stage-caption small { display: block; margin-top: 6px; color: var(--muted); font-size: .72rem; letter-spacing: .1em; }

.dashboard { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; padding: 10px 0 40px; }
.panel {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(26,33,63,.78), rgba(13,18,38,.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(130deg, rgba(255,255,255,.045), transparent 35%); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.panel-heading.compact { margin-bottom: 15px; }
.panel h2 { margin: 0; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 1.55rem; font-weight: 500; }
.saved-label, .privacy-chip { color: var(--muted); font-size: .76rem; }
.privacy-chip { padding: 5px 9px; border: 1px solid var(--stroke); border-radius: 999px; }
.mood-field { margin: 0 0 22px; padding: 0; border: 0; }
.mood-field legend, .note-label { display: block; margin-bottom: 11px; color: #cbd1e2; font-size: .88rem; }
.mood-options { display: flex; flex-wrap: wrap; gap: 9px; }
.mood-options button {
  min-height: 40px; padding: 9px 13px; display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--stroke); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.025); cursor: pointer;
}
.mood-options button:hover, .mood-options button[aria-pressed="true"] { color: var(--text); border-color: rgba(231,189,115,.36); background: rgba(231,189,115,.08); }
.mood-options i { width: 9px; height: 9px; border-radius: 50%; }
.mood-pink { background: var(--pink); }.mood-blue { background: var(--blue); }.mood-gold { background: var(--gold); }.mood-purple { background: var(--purple); }
textarea, .return-input input {
  width: 100%; border: 1px solid var(--stroke); color: var(--text); background: rgba(5,8,20,.45); outline: none;
}
textarea { min-height: 110px; resize: vertical; padding: 14px 15px; border-radius: 17px; line-height: 1.7; }
textarea:focus, .return-input:focus-within { border-color: rgba(159,143,218,.55); box-shadow: 0 0 0 4px rgba(159,143,218,.08); }
textarea::placeholder, input::placeholder { color: #6f7897; }
.note-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: .76rem; }
.secondary-button { padding: 10px 15px; border-radius: 999px; color: var(--text); background: rgba(159,143,218,.15); border: 1px solid rgba(159,143,218,.3); }

.route-list { display: grid; gap: 4px; }
.route-list button { width: 100%; min-height: 66px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 10px 6px; border: 0; border-bottom: 1px solid rgba(255,255,255,.07); color: inherit; text-align: left; background: transparent; cursor: pointer; }
.route-list button:last-child { border-bottom: 0; }
.route-list button:hover { padding-left: 10px; background: rgba(255,255,255,.025); border-radius: 14px; }
.route-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--gold); border: 1px solid var(--stroke); border-radius: 13px; background: rgba(255,255,255,.025); }
.route-list strong { display: block; margin-bottom: 4px; font-size: .93rem; }
.route-list small { display: block; color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.route-list em { color: var(--muted); font-size: .82rem; font-style: normal; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(131,201,174,.7); }

.return-call-panel { grid-column: 1 / 2; }
.return-call-panel > p { margin: -2px 0 20px; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.return-input { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden; background: rgba(5,8,20,.45); }
.return-input input { min-width: 0; padding: 14px 15px; border: 0; background: transparent; }
.return-input button { padding: 0 18px; color: #1a1730; font-weight: 750; background: var(--gold); }
.last-call { margin-top: 14px; padding: 12px 14px; border-left: 2px solid var(--purple); background: rgba(159,143,218,.06); border-radius: 0 12px 12px 0; }
.last-call span { color: var(--muted); font-size: .7rem; letter-spacing: .12em; }
.last-call p { margin: 4px 0 0; color: #d9deec; line-height: 1.55; }

.vow-panel { display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 80% 12%, rgba(159,143,218,.17), transparent 18rem), linear-gradient(145deg, rgba(30,36,69,.82), rgba(13,18,38,.72)); }
.vow-panel blockquote { margin: 6px 0 22px; color: #d9deec; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 1.06rem; line-height: 1.85; }
.names { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .88rem; }
.names i { color: var(--pink); font-size: .72rem; font-style: normal; }
.anniversary { align-self: flex-start; margin-top: 18px; padding: 6px 0; border: 0; color: var(--gold); background: transparent; letter-spacing: .14em; cursor: pointer; }

footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 34px; display: flex; align-items: center; justify-content: space-between; color: #69728e; font-size: .68rem; letter-spacing: .12em; }
#secretButton { border: 0; color: #4f5873; background: transparent; font-size: 1.8rem; cursor: pointer; }

.toast-region { position: fixed; z-index: 20; right: 22px; bottom: 22px; display: grid; gap: 10px; pointer-events: none; }
.toast { max-width: min(360px, calc(100vw - 44px)); padding: 13px 16px; border: 1px solid rgba(231,189,115,.22); border-radius: 15px; color: var(--text); background: rgba(18,23,45,.94); box-shadow: var(--shadow); animation: toast-in .28s ease both; }
.toast small { display: block; margin-top: 4px; color: var(--muted); }

dialog { width: min(460px, calc(100% - 32px)); padding: 34px; border: 1px solid rgba(159,143,218,.3); border-radius: 26px; color: var(--text); background: radial-gradient(circle at 50% 0%, rgba(159,143,218,.2), transparent 16rem), #11162c; box-shadow: 0 50px 120px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(4,6,15,.72); backdrop-filter: blur(8px); }
dialog h2 { margin: 0 0 15px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 1.8rem; font-weight: 500; }
dialog p:not(.dialog-kicker) { color: #c5ccdf; line-height: 1.8; }
.dialog-close { position: absolute; top: 13px; right: 15px; width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; font-size: 1.4rem; }
.dialog-sign { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--stroke); color: var(--gold); font-size: .78rem; letter-spacing: .08em; }

.soft-mode .welcome h1 { color: #fff7fb; text-shadow: 0 0 34px rgba(228,167,187,.2); }
.soft-mode .moon-core { background: radial-gradient(circle at 35% 30%, #fff1f7, #d4b7df 44%, #8f6aa6 77%, #493753); }
.soft-mode .ambient-two { background: var(--pink); opacity: .18; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes breathe { 0%,100% { transform: scale(.96); opacity: .28; } 50% { transform: scale(1.08); opacity: .75; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cat-bop { 0%,100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-8px) rotate(-4deg); } 70% { transform: translateY(-3px) rotate(4deg); } }

@media (max-width: 860px) {
  .welcome { grid-template-columns: 1fr; gap: 10px; padding-top: 70px; }
  .welcome-copy { text-align: center; }
  .welcome-note { margin-inline: auto; }
  .welcome-actions { justify-content: center; }
  .light-stage { min-height: 360px; }
  .dashboard { grid-template-columns: 1fr; }
  .return-call-panel { grid-column: auto; }
}

@media (max-width: 560px) {
  .topbar, main, footer { width: min(100% - 24px, 1180px); }
  .topbar { height: 72px; }
  .brand strong { font-size: .7rem; }
  .brand small { font-size: .68rem; }
  .connection { display: none; }
  .welcome { min-height: auto; padding-top: 56px; }
  .welcome h1 { font-size: 2.75rem; }
  .welcome-note { font-size: 1rem; }
  .welcome-actions { flex-direction: column; }
  .primary-button { width: min(240px, 100%); }
  .light-stage { min-height: 330px; transform: scale(.9); margin-inline: -15px; }
  .panel { padding: 22px 18px; border-radius: 23px; }
  .mood-options button { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .return-input { grid-template-columns: 1fr; }
  .return-input button { min-height: 44px; }
  footer { gap: 12px; text-align: center; }
  footer span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
