:root {
  --bg: #02040a;
  --text: rgba(245, 238, 224, 0.92);
  --text-soft: rgba(245, 238, 224, 0.45);
  --accent: #e2af57;
  --panel: rgba(8, 12, 22, 0.78);
  --border: rgba(233, 177, 75, 0.2);
}

* {
  box-sizing: border-box;
  font-family:serif
}

button {
  font: inherit;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.page {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.page-loading {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at center, rgba(226, 175, 87, 0.12), rgba(2, 4, 10, 0) 45%),
    rgba(2, 4, 10, 0.88);
  backdrop-filter: blur(8px);
}

.page-loading[hidden] {
  display: none;
}

.page-loading__inner {
  min-width: min(82vw, 280px);
  padding: 28px 26px 24px;
  border: 1px solid rgba(226, 175, 87, 0.24);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 203, 120, 0.1), rgba(255, 203, 120, 0.02)),
    rgba(10, 14, 24, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.page-loading__spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border: 2px solid rgba(255, 226, 175, 0.14);
  border-top-color: rgba(226, 175, 87, 0.95);
  border-right-color: rgba(244, 197, 112, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(226, 175, 87, 0.18);
  animation: page-loading-spin 0.9s linear infinite;
}

.page-loading__text {
  color: rgba(245, 238, 224, 0.88);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.bg-canvas,
.spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.spark-canvas {
  z-index: 18;
  pointer-events: none;
}

.toolbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.back-btn,
.tool-chip {
  border: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.85);
  color: var(--text);
  border-radius: 999px;
}

.back-btn {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

@keyframes page-loading-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.shell {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;
  padding: 20vh 0 120px 0;
  min-height: 650px;
  gap: 40px;
}

@media screen and (max-width: 376px) {
  .shell {
    padding: 12vh 0 100px 0;
    gap: 28px;
  }
}

@media screen and (max-width: 320px) {
  .shell {
    padding: 0 0 100px 0;
    gap: 28px;
    transform: scale(0.65);
    min-height: 100vh;
  }
}

.age-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(88px, 24vw, 180px);
  font-weight: 700;
  opacity: 0.06;
  pointer-events: none;
}

.center {
  position: relative;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.ring {
  position: relative;
  width: clamp(90px, 26vw, 142px);
  height: clamp(90px, 26vw, 142px);
  margin-bottom: 16px;
}

.ring::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--ring-color), rgba(255, 255, 255, 0.55), transparent 48%, var(--ring-color));
  animation: spin 4s linear infinite;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #070b14;
}

.ring-core {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  overflow: hidden;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(233, 177, 75, 0.12);
  font-size: 42px;
}

.ring-core img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.age-label {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 4px;
  font-size: clamp(18px, 4.2vw, 28px);
  letter-spacing: 0.08em;
  color: rgba(255, 244, 225, 0.92);
}

.age-label .age-number {
  font-size: clamp(38px, 10vw, 56px);
  line-height: 1;
  font-weight: 700;
  color: #f1a34a;
  text-shadow:
    0 0 10px rgba(255, 171, 83, 0.16),
    0 0 22px rgba(255, 171, 83, 0.08);
}

.age-label .age-copy {
  font-size: clamp(20px, 5vw, 30px);
  letter-spacing: 0.12em;
}

.age-label.birth-mode {
  display: block;
  font-size: clamp(24px, 6vw, 32px);
  letter-spacing: 0.16em;
}

.hero-hint {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--text-soft);
}

.date-block {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.remote-tip {
  width: min(100%, 320px);
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(226, 175, 87, 0.2);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 191, 95, 0.08), rgba(255, 191, 95, 0.02)),
    rgba(12, 16, 28, 0.82);
  color: rgba(245, 238, 224, 0.78);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.03em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 32px rgba(0, 0, 0, 0.2);
}

.date-main {
  position: relative;
  padding-left: 14px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #df9d44;
  text-shadow: 0 0 12px rgba(223, 157, 68, 0.12);
}

.date-main::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c7832e;
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(223, 157, 68, 0.4);
}

.date-lunar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(196, 137, 55, 0.24);
  background:
    linear-gradient(180deg, rgba(117, 65, 18, 0.16), rgba(62, 32, 10, 0.18)),
    rgba(36, 20, 8, 0.68);
  color: rgba(229, 189, 124, 0.94);
  font-size: 13px;
  line-height: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 222, 176, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.date-lunar::before {
  content: "☾";
  font-size: 16px;
  color: #f0c770;
}

.date-tag,
.badge,
.countdown {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.date-tag {
  padding: 4px 14px;
  border-radius: 999px;
  color: #f0b24f;
  font-size: 12px;
  letter-spacing: 0.08em;
  background:
    linear-gradient(180deg, rgba(255, 191, 95, 0.08), rgba(255, 191, 95, 0.02)),
    rgba(28, 18, 10, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 224, 166, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.14);
}

.date-tag.is-future {
  color: #c9b0ff;
  border-color: rgba(145, 112, 226, 0.32);
  background:
    linear-gradient(180deg, rgba(151, 118, 235, 0.11), rgba(151, 118, 235, 0.03)),
    rgba(20, 16, 34, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(223, 212, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.14);
}

.badge {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.68);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  transform-origin: center;
}

.badge.bump {
  animation: badgePulse 0.46s cubic-bezier(0.2, 0.9, 0.22, 1);
}

.wish {
  position: fixed;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.wish.show {
  animation: wishInOut 2.8s ease forwards;
}
.countdown-box{
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.countdown {
  /* position: fixed;
  left: 50%;
  bottom: 148px; */
  width: min(100%, 250px);
  /* transform: translateX(-50%); */
  /* z-index: 5; */
  padding: 12px 16px;
  border-radius: 22px;
  text-align: center;
}

.countdown-title {
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(202, 181, 255, 0.82);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.countdown-item strong {
  display: block;
  font-size: 24px;
}

.countdown-item span {
  font-size: 10px;
  color: var(--text-soft);
}

.nav {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-btn {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(213, 225, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(8, 12, 22, 0.82);
  color: rgba(245, 242, 236, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background 0.22s ease;

    display: inline-flex;
    justify-content: center;
    align-items: center;
}
.nav-btn.prev {
  --active-rotate: 180deg;
  transform: rotate(180deg);
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.nav-btn:active {
  transform: scale(0.94) rotate(var(--active-rotate, 0deg));
}

.nav-btn:hover {
  border-color: rgba(255, 209, 131, 0.24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 28px rgba(0, 0, 0, 0.26),
    0 0 18px rgba(255, 176, 79, 0.08);
}

.nav-btn.icon-chart {
  font-size: 24px;
}

.indicator {
  min-width: 94px;
  padding: 0 4px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(244, 237, 227, 0.82);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}

.matrix-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 5;
  padding: 12px 12px 11px;
  /* border: 1px solid rgba(255, 255, 255, 0.08); */
  /* border-radius: 16px; */
  /* background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    linear-gradient(180deg, rgba(18, 22, 35, 0.92), rgba(8, 11, 20, 0.88));
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -12px 22px rgba(0, 0, 0, 0.16); */
  backdrop-filter: blur(16px);
}

.matrix-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background:
    radial-gradient(circle at 22% 16%, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 24% 28%, rgba(255, 178, 86, 0.11), transparent 26%),
    radial-gradient(circle at 82% 84%, rgba(146, 112, 255, 0.09), transparent 30%);
  pointer-events: none;
}


.dots {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dot-row {
  display: flex;
  gap: 4px;
}

.dot {
  position: relative;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(215, 220, 233, 0.6), rgba(78, 86, 106, 0.32));
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0.48;
  transition: transform 0.22s ease, opacity 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.dot::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 1px;
  height: 2px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.32);
  opacity: 0.72;
}

.dot.is-milestone {
  width: 8px;
  height: 8px;
}

.dot.has-blessing {
  opacity: 0.9;
  background: linear-gradient(180deg, rgba(255, 212, 136, 0.95), rgba(145, 96, 30, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 245, 0.46),
    0 0 10px rgba(227, 163, 80, 0.34);
}

.dot.has-care {
  opacity: 0.82;
  background: linear-gradient(180deg, rgba(196, 172, 255, 0.92), rgba(90, 64, 154, 0.8));
  box-shadow:
    inset 0 1px 0 rgba(247, 241, 255, 0.36),
    0 0 10px rgba(140, 105, 226, 0.3);
}

.dot.is-current {
  opacity: 1;
  transform: scale(1.26);
  background: linear-gradient(180deg, #ffd79e, #f4a548 58%, #ad6425);
  box-shadow:
    inset 0 1px 0 rgba(255, 251, 240, 0.62),
    0 0 16px rgba(255, 176, 79, 0.8),
    0 0 28px rgba(255, 144, 41, 0.32);
}

.dot.is-current::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 79, 0.38), rgba(255, 176, 79, 0));
  pointer-events: none;
}

.stats-panel {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 20% 10%, rgba(233, 177, 75, 0.12), transparent 25%),
    radial-gradient(circle at 80% 12%, rgba(110, 118, 255, 0.12), transparent 25%),
    #070b14;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0.32s;
}

.stats-panel.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.28s ease,
    transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1),
    visibility 0s linear 0s;
}

.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.26s ease 0.04s, transform 0.3s ease 0.04s;
}

.stats-title {
  font-size: 15px;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.stats-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 14px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.28s ease 0.08s, transform 0.32s ease 0.08s;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 8px;
  text-align: center;
}

.summary-card strong {
  display: block;
  font-size: 26px;
}

.summary-card span {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  color: var(--text-soft);
}

.stats-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 28px;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.3s ease 0.12s, transform 0.34s ease 0.12s;
}

.stats-panel.show .stats-head,
.stats-panel.show .stats-summary,
.stats-panel.show .stats-scroll {
  opacity: 1;
  transform: translateY(0);
}

.stats-section-title {
  margin: 14px 0 10px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--text-soft);
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-age {
  width: 44px;
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.stat-bar {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.bar-like,
.bar-care {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.bar-like {
  left: 0;
  background: linear-gradient(90deg, #c9780a, #e8a830);
}

.bar-care {
  background: linear-gradient(90deg, #6030a0, #9060d0);
}

.stat-total {
  width: 62px;
  text-align: right;
  font-size: 11px;
}

.tap-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes wishInOut {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-6deg);
  }
  18% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  76% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.96) translateY(-6px);
  }
}

@keyframes badgePulse {
  0% {
    transform:  scale(1);
    box-shadow: 0 0 0 rgba(255, 176, 79, 0);
  }
  35% {
    transform:  scale(1.14);
    box-shadow:
      0 0 0 1px rgba(255, 196, 120, 0.28),
      0 0 18px rgba(255, 176, 79, 0.36);
  }
  65% {
    transform: scale(0.96);
    box-shadow:
      0 0 0 1px rgba(255, 196, 120, 0.16),
      0 0 10px rgba(255, 176, 79, 0.18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 176, 79, 0);
  }
}
