:root {
  --bg-top: #f8f8f6;
  --bg-bottom: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-border: rgba(17, 24, 39, 0.08);
  --text: #122033;
  --muted: rgba(18, 32, 51, 0.62);
  --accent: #d68539;
  --past: rgba(238, 155, 76, 0.92);
  --future: rgba(18, 32, 51, 0.08);
  --milestone: #e15b42;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --sun-x: 78%;
  --sun-y: 18%;
  --sun-glow: rgba(255, 222, 140, 0.54);
  --sun-core: rgba(255, 243, 194, 0.98);
  --sun-mid: rgba(255, 208, 114, 0.94);
  --sun-rim: rgba(255, 160, 78, 0.9);
  --sun-aura: rgba(255, 223, 146, 0.28);
  --sun-size: 84px;
  --sun-haze-size: 180px;
  --sun-spark: rgba(255, 249, 214, 0.92);
  --sun-opacity: 0.92;
  --sun-haze-opacity: 0.9;
  --series-top: rgba(255, 214, 164, 0.18);
  --series-glow: rgba(255, 173, 122, 0.06);
  --series-border: rgba(214, 133, 57, 0.14);
  --series-shadow: rgba(214, 133, 57, 0.06);
  --series-line: rgba(214, 133, 57, 0.38);
  --series-soft: rgba(255, 220, 186, 0.42);
  --series-info-bg: rgba(214, 133, 57, 0.09);
  --series-info-border: rgba(214, 133, 57, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", Arial, sans-serif;
  color: var(--text);
}

body {
  background:
    radial-gradient(circle at var(--sun-x) var(--sun-y), var(--sun-spark), transparent 2.6%),
    radial-gradient(circle at var(--sun-x) var(--sun-y), var(--sun-glow), transparent 14%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  overflow-y: auto;
  overflow-x: hidden;
  transition: background 1200ms ease, color 600ms ease;
}

body.theme-ready {
  color: #f6f2ea;
}

.ambient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at var(--sun-x) var(--sun-y), rgba(255, 251, 226, 0.92), transparent 2.2%),
    radial-gradient(circle at var(--sun-x) var(--sun-y), rgba(255, 241, 188, 0.88), transparent 6.8%),
    radial-gradient(circle at var(--sun-x) var(--sun-y), rgba(255, 208, 124, 0.44), transparent 18%),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.34), transparent 22%),
    radial-gradient(circle at 80% 15%, rgba(255, 211, 160, 0.16), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(255, 123, 77, 0.14), transparent 35%);
  pointer-events: none;
  transition: opacity 1200ms ease, filter 1200ms ease, background 1200ms ease;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  transition: left 1200ms ease, top 1200ms ease, opacity 1200ms ease, transform 1200ms ease, background 1200ms ease, box-shadow 1200ms ease;
}

.ambient::before {
  width: var(--sun-size);
  height: var(--sun-size);
  left: calc(var(--sun-x) - (var(--sun-size) / 2));
  top: calc(var(--sun-y) - (var(--sun-size) / 2));
  background: radial-gradient(circle at 35% 35%, var(--sun-core), var(--sun-mid) 50%, var(--sun-rim) 82%, rgba(255, 135, 70, 0.84) 100%);
  box-shadow:
    0 0 0 10px rgba(255, 241, 189, 0.18),
    0 0 44px rgba(255, 215, 124, 0.46),
    0 0 96px rgba(255, 173, 93, 0.28);
  opacity: var(--sun-opacity);
}

.ambient::after {
  width: var(--sun-haze-size);
  height: var(--sun-haze-size);
  left: calc(var(--sun-x) - (var(--sun-haze-size) / 2));
  top: calc(var(--sun-y) - (var(--sun-haze-size) / 2));
  background: radial-gradient(circle, var(--sun-aura), rgba(255, 223, 146, 0) 68%);
  opacity: var(--sun-haze-opacity);
}

body.theme-ready .ambient {
  filter: saturate(1.14) brightness(1.02);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
}

.dashboard-card {
  width: min(1600px, 100%);
  min-height: calc(100vh - 28px);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 12px;
  transition: background 1200ms ease, border-color 1200ms ease, box-shadow 1200ms ease;
}

body.theme-ready .dashboard-card {
  background: rgba(8, 14, 28, 0.54);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 80px rgba(3, 8, 20, 0.22);
}

.hero,
.button-row,
.toolbar,
.grid-legend,
.progress-meta,
.form-grid,
.life-age-row {
  display: flex;
  gap: 12px;
}

.hero {
  justify-content: space-between;
  align-items: stretch;
  display: grid;
  grid-template-columns: minmax(260px, 0.95fr) minmax(520px, 1.35fr) minmax(220px, 0.7fr);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 11px;
  color: var(--accent);
}

h1 {
  font-family: "Songti SC", SimSun, "Microsoft YaHei", serif;
  font-size: clamp(24px, 2.8vw, 42px);
  line-height: 1.08;
}

.subtitle {
  max-width: 820px;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.brand-mark {
  margin-top: 12px;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-sky-text,
.panel {
  transition: background 1200ms ease, border-color 1200ms ease, color 600ms ease;
}

.hero-sky-text {
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  gap: 6px;
  text-align: right;
  padding-right: 10px;
  justify-self: end;
  width: min(320px, 100%);
  max-width: 320px;
}

body.theme-ready .panel {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

body.theme-ready .hero-sky-text {
  background: transparent;
  border-color: transparent;
}

.hero-sky-text span,
.hero-sky-text small,
.panel-title p,
.grid-hint,
.share-preview,
.compact-field span,
.live-stats .stat-item span,
.timeline-meta,
.empty-note,
.brand-mark {
  color: var(--muted);
}

body.theme-ready .hero-sky-text span,
body.theme-ready .hero-sky-text small,
body.theme-ready .panel-title p,
body.theme-ready .grid-hint,
body.theme-ready .share-preview,
body.theme-ready .compact-field span,
body.theme-ready .live-stats .stat-item span,
body.theme-ready .timeline-meta,
body.theme-ready .empty-note,
body.theme-ready .brand-mark,
body.theme-ready .subtitle,
body.theme-ready .countdown-segment span,
body.theme-ready .age-chip span {
  color: rgba(246, 242, 234, 0.74);
}

.hero-sky-text span {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-sky-text strong {
  font-size: clamp(42px, 3.4vw, 56px);
  line-height: 0.96;
  margin: 0;
  text-shadow: 0 10px 30px rgba(14, 20, 36, 0.18);
}

.hero-sky-text small {
  font-size: 22px;
  font-weight: 600;
}

.current-datetime {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  width: 100%;
  overflow: hidden;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.countdown-hero {
  background:
    linear-gradient(135deg, rgba(255, 233, 176, 0.72), rgba(255, 136, 90, 0.58)),
    rgba(255, 255, 255, 0.7);
  border-color: rgba(214, 133, 57, 0.16);
  justify-content: center;
  --life-progress-deg: 0deg;
  --life-marker-rotation: -90deg;
}

body.theme-ready .countdown-hero {
  background:
    linear-gradient(135deg, rgba(255, 227, 157, 0.22), rgba(255, 131, 88, 0.28)),
    rgba(255, 255, 255, 0.08);
}

.countdown-hero-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.countdown-hero-body {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.life-clock {
  display: flex;
  align-items: center;
  justify-content: center;
}

.life-clock-ring {
  position: relative;
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.78) 0 41%, transparent 42% 100%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.5) 0deg 2deg, transparent 2deg 15deg),
    conic-gradient(from 0deg, rgba(173, 73, 30, 0.96) 0deg, rgba(255, 166, 92, 0.94) var(--life-progress-deg), rgba(255,255,255,0.16) var(--life-progress-deg), rgba(255,255,255,0.16) 360deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28), 0 16px 36px rgba(164, 77, 28, 0.16);
}

.life-clock-notch {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(255, 248, 234, 0.98);
  box-shadow:
    0 0 0 4px rgba(255, 214, 162, 0.16),
    0 0 16px rgba(255, 191, 120, 0.32);
}

.life-clock-marker {
  position: absolute;
  inset: 0;
  transform: rotate(var(--life-marker-rotation));
  transform-origin: 50% 50%;
}

.life-clock-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 244, 220, 0.98);
  box-shadow:
    0 0 0 5px rgba(255, 214, 162, 0.18),
    0 0 22px rgba(255, 181, 112, 0.46);
}

.life-clock-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 22px;
  width: 2px;
  height: 18px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(255, 238, 208, 0.9);
  opacity: 0.8;
}

.life-clock-core {
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  background: rgba(255, 248, 236, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}

.life-clock-core strong {
  font-size: 32px;
  line-height: 1;
  color: #9d431c;
}

.countdown-hero-grid .countdown-segment {
  background: rgba(255, 255, 255, 0.42);
  border-color: rgba(255, 255, 255, 0.36);
  min-width: 0;
  overflow: hidden;
  padding: 16px 8px;
}

body.theme-ready .countdown-hero-grid .countdown-segment {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
}

.countdown-hero-grid .countdown-segment strong {
  font-size: clamp(18px, calc(118px / var(--digits, 2)), 44px);
  color: #a53f18;
}

body.theme-ready .countdown-hero-grid .countdown-segment strong {
  color: #ffe4a8;
}

body.theme-ready .life-clock-ring {
  background:
    radial-gradient(circle at 50% 50%, rgba(16, 22, 37, 0.86) 0 41%, transparent 42% 100%),
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.16) 0deg 2deg, transparent 2deg 15deg),
    conic-gradient(from 0deg, rgba(255, 196, 116, 0.96) 0deg, rgba(255, 143, 95, 0.94) var(--life-progress-deg), rgba(255,255,255,0.1) var(--life-progress-deg), rgba(255,255,255,0.1) 360deg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 18px 42px rgba(4, 8, 20, 0.18);
}

body.theme-ready .life-clock-marker::before {
  background: rgba(255, 233, 182, 0.98);
  box-shadow:
    0 0 0 5px rgba(255, 184, 118, 0.14),
    0 0 22px rgba(255, 170, 95, 0.42);
}

body.theme-ready .life-clock-marker::after {
  background: rgba(255, 226, 168, 0.86);
}

body.theme-ready .life-clock-core {
  background: rgba(16, 22, 37, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

body.theme-ready .life-clock-core strong {
  color: #ffe4a8;
}

body.theme-ready .life-clock-notch {
  background: rgba(255, 236, 190, 0.96);
  box-shadow:
    0 0 0 4px rgba(255, 186, 120, 0.12),
    0 0 16px rgba(255, 170, 92, 0.28);
}

.setup-grid,
.content-grid {
  display: grid;
  gap: 12px;
}

.setup-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.9fr);
  align-items: stretch;
}

.content-grid {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.72fr);
  align-items: start;
}

.side-stack {
  display: grid;
  grid-template-rows: auto auto minmax(280px, 1fr);
  gap: 12px;
  min-height: 0;
  align-self: start;
  position: sticky;
  top: 14px;
}

.stats-stack {
  grid-template-rows: auto auto;
  height: 100%;
}

.content-grid .panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), transparent),
    var(--panel);
}

.content-grid .panel::before {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(214, 133, 57, 0.9), rgba(255, 255, 255, 0.18));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.series-panel {
  position: relative;
  background:
    linear-gradient(180deg, var(--series-top), rgba(255, 255, 255, 0.02) 24%, transparent 100%),
    linear-gradient(135deg, var(--series-glow), rgba(255, 219, 178, 0.03)),
    var(--panel);
  border-color: var(--series-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 18px 40px var(--series-shadow);
}

.series-panel::before {
  background: linear-gradient(90deg, var(--series-line), var(--series-soft));
}

.series-grid-panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 22px 48px rgba(214, 133, 57, 0.08);
}

.series-stack {
  position: sticky;
}

body.theme-ready .series-panel {
  background:
    linear-gradient(180deg, var(--series-top), rgba(255, 255, 255, 0.02) 22%, transparent 100%),
    linear-gradient(135deg, var(--series-glow), rgba(255, 226, 185, 0.03)),
    rgba(21, 26, 43, 0.54);
  border-color: var(--series-border);
  box-shadow: inset 0 1px 0 rgba(255, 245, 221, 0.12), 0 22px 48px rgba(4, 8, 20, 0.16);
}

.series-info {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--series-info-bg);
  border: 1px solid var(--series-info-border);
}

body.theme-ready .series-info {
  color: rgba(246, 242, 234, 0.74);
  background: var(--series-info-bg);
  border-color: var(--series-info-border);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 10px;
}

.panel-title h2 {
  font-size: 18px;
}

.panel-title p {
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.life-age-row {
  align-items: end;
}

.life-age-row > label {
  flex: 1;
}

label,
.compact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: background 600ms ease, border-color 600ms ease, color 600ms ease;
}

textarea {
  resize: none;
  overflow: auto;
}

body.theme-ready input,
body.theme-ready textarea,
body.theme-ready select {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #f6f2ea;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(214, 133, 57, 0.55);
  box-shadow: 0 0 0 3px rgba(214, 133, 57, 0.12);
}

button {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease, border-color 300ms ease, color 300ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, #ffe19a, #ff8f53);
  color: #1e160a;
  font-weight: 600;
}

.secondary-btn {
  background: rgba(17, 24, 39, 0.07);
  color: var(--text);
  border: 1px solid rgba(17, 24, 39, 0.08);
}

body.theme-ready .secondary-btn,
body.theme-ready .ghost-btn,
body.theme-ready .floating-export-btn {
  color: #f6f2ea;
  border-color: rgba(255, 255, 255, 0.16);
}

.ghost-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(17, 24, 39, 0.1);
}

.live-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.stat-item,
.countdown-segment,
.age-chip,
.milestone-countdown {
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.05);
  border: 1px solid rgba(17, 24, 39, 0.06);
  padding: 12px;
  transition: background 600ms ease, border-color 600ms ease;
}

body.theme-ready .stat-item,
body.theme-ready .countdown-segment,
body.theme-ready .age-chip,
body.theme-ready .milestone-countdown {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.live-stats .stat-item strong {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
}

.live-stats .stat-item span {
  font-size: 12px;
}

.countdown,
.age-readout {
  display: grid;
  gap: 8px;
}

.countdown {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.age-readout {
  grid-template-columns: 1fr;
}

.countdown-segment strong,
.age-chip strong {
  font-size: clamp(16px, 1.8vw, 24px);
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.countdown-segment span,
.age-chip span {
  color: var(--muted);
  font-size: 12px;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  justify-content: center;
}

.progress-bar {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.06);
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

body.theme-ready .progress-bar {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffe39d, #ff8358);
  transition: width 800ms ease;
}

.progress-meta {
  justify-content: space-between;
  align-items: baseline;
}

.floating-export-btn {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  padding: 14px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe19a, #ff8f53);
  color: #1e160a;
  font-weight: 700;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.share-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.share-preview-modal[hidden] {
  display: none;
}

.share-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 24, 0.58);
  backdrop-filter: blur(12px);
}

.share-preview-panel {
  position: relative;
  width: min(312px, calc(100vw - 28px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 12px;
  border-radius: 28px;
  background: rgba(255, 251, 246, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 28px 80px rgba(8, 12, 24, 0.26);
}

body.theme-ready .share-preview-panel {
  background: rgba(16, 22, 37, 0.88);
  border-color: rgba(255, 255, 255, 0.16);
}

.share-preview-image {
  width: 100%;
  display: block;
  border-radius: 22px;
  max-height: 68vh;
  object-fit: contain;
  box-shadow: 0 18px 50px rgba(16, 22, 37, 0.18);
}

.share-preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.icon-action-btn {
  display: grid;
  place-items: center;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.06);
  color: var(--text);
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.icon-action-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.theme-ready .icon-action-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #f6f2ea;
  border-color: rgba(255, 255, 255, 0.16);
}

.toolbar {
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
}

.grid-legend {
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
}

.legend {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 6px;
}

.legend.past {
  background: var(--past);
}

.legend.future {
  background: var(--future);
}

.legend.milestone {
  background: var(--milestone);
}

.grid-hint {
  font-size: 12px;
}

.life-grid {
  min-height: 260px;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
  gap: 4px;
  align-content: start;
  padding-right: 2px;
}

.grid-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--future);
  padding: 0;
  min-width: 0;
  border: 0;
  position: relative;
}

.grid-cell:hover {
  transform: none;
}

.grid-cell.past {
  background: var(--past);
}

.grid-cell.current {
  outline: 1px solid rgba(255, 255, 255, 0.9);
}

body:not(.theme-ready) .grid-cell.current {
  outline-color: rgba(17, 24, 39, 0.45);
}

.grid-cell.milestone::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 2px;
  border: 1.5px solid var(--milestone);
}

.grid-cell.selected {
  transform: scale(1.18);
  z-index: 1;
}

.node-form {
  display: grid;
  gap: 10px;
}

.milestone-countdown {
  min-height: 84px;
  line-height: 1.45;
}

.series-panel .milestone-countdown,
.series-panel .timeline-item,
.series-panel .series-info {
  backdrop-filter: blur(4px);
}

.timeline {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 220px;
  max-height: 480px;
}

.age-summary {
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.05);
  border: 1px solid rgba(17, 24, 39, 0.06);
  padding: 12px;
}

body.theme-ready .age-summary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.age-summary strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.age-summary span {
  font-size: 22px;
  line-height: 1.2;
}

.timeline-item {
  position: relative;
  padding: 12px 12px 12px 18px;
  border-left: 2px solid rgba(17, 24, 39, 0.1);
  background: rgba(17, 24, 39, 0.04);
  border-radius: 0 16px 16px 0;
  text-align: left;
  color: inherit;
}

.timeline-item:hover {
  transform: none;
}

body.theme-ready .timeline-item {
  border-left-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.timeline-item.selected {
  border-left-color: var(--milestone);
  box-shadow: inset 0 0 0 1px rgba(225, 91, 66, 0.35);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--milestone);
  box-shadow: 0 0 0 4px rgba(225, 91, 66, 0.16);
}

.timeline-item h3 {
  font-size: 15px;
}

.timeline-item p {
  margin-top: 5px;
  line-height: 1.45;
  font-size: 13px;
  color: var(--muted);
}

body.theme-ready .timeline-item p {
  color: rgba(246, 242, 234, 0.72);
}

.timeline-meta {
  font-size: 12px;
  margin-top: 6px;
}

.empty-note {
  font-size: 13px;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 0 14px 20px;
}

.beian-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(18, 32, 51, 0.68);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.beian-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.beian-link img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

body.theme-ready .beian-link {
  color: rgba(246, 242, 234, 0.74);
}

body.theme-ready .beian-link:hover {
  color: #f6f2ea;
}

@media (max-width: 1200px) {
  .setup-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .content-grid::before {
    display: none;
  }

  .side-stack {
    position: static;
  }

  .countdown-hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .countdown-hero-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    padding: 10px;
  }

  .dashboard-card {
    min-height: calc(100vh - 20px);
    padding: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .life-age-row {
    flex-direction: column;
    align-items: stretch;
  }

  .countdown {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .live-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .dashboard-card {
    border-radius: 22px;
  }

  .countdown,
  .countdown-hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .life-clock-ring {
    width: 156px;
  }

  .age-readout {
    grid-template-columns: 1fr;
  }

  .live-stats {
    grid-template-columns: 1fr 1fr;
  }

  .hero-sky-text {
    text-align: left;
    justify-self: start;
    max-width: none;
  }

  .floating-export-btn {
    right: 14px;
    bottom: 14px;
  }
}
