/* ========================================
   Glass Stack Cards - macOS Sequoia Style
   人生窗口时间线 · 堆叠立体玻璃卡
   ======================================== */

:root {
  --glass-blur: blur(40px) saturate(180%);
  --grad-active: linear-gradient(135deg, #00c853 0%, #00e676 50%, #69f0ae 100%);
  --grad-warning: linear-gradient(135deg, #ff6f00 0%, #ffa726 50%, #ffcc80 100%);
  --grad-closed: linear-gradient(135deg, #d32f2f 0%, #f44336 50%, #ef9a9a 100%);
  --grad-future: linear-gradient(135deg, #1976d2 0%, #42a5f5 50%, #90caf9 100%);
  --num-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
}

/* === Timeline Stack === */
#timeline {
  padding: 80px 0;
  position: relative;
}

.tl-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 48px;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.tl-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: grid;
  grid-template-columns: 100px 1fr 200px;
  align-items: stretch;
  min-height: 140px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.02);
}

.tl-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.1),
    0 0 0 1px var(--accent);
}

.tl-age-block {
  position: relative;
  background: var(--bg-card-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.tl-age-block::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.tl-card.active .tl-age-block::before { background: var(--grad-active); }
.tl-card.warning .tl-age-block::before { background: var(--grad-warning); }
.tl-card.closed .tl-age-block::before { background: var(--grad-closed); }
.tl-card.future .tl-age-block::before { background: var(--grad-future); }

.tl-age-num {
  font-family: var(--num-font);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tl-age-lbl {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
  font-weight: 600;
}

.tl-content-block {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.tl-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.tl-desc {
  font-family: var(--font-accent);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

.tl-status-block {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border-left: 1px solid var(--border);
  background: var(--bg-base);
}

.tl-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  align-self: flex-start;
  color: #fff;
}

.tl-card.active .tl-status-pill { background: var(--grad-active); box-shadow: 0 2px 8px rgba(0, 200, 83, 0.3); }
.tl-card.warning .tl-status-pill { background: var(--grad-warning); box-shadow: 0 2px 8px rgba(255, 111, 0, 0.3); }
.tl-card.closed .tl-status-pill { background: var(--grad-closed); box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3); }
.tl-card.future .tl-status-pill { background: var(--grad-future); box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3); }

.tl-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-dot 2s ease-in-out infinite;
}

.tl-progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.tl-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-card.active .tl-progress-fill { background: var(--grad-active); }
.tl-card.warning .tl-progress-fill { background: var(--grad-warning); }
.tl-card.closed .tl-progress-fill { background: var(--grad-closed); }
.tl-card.future .tl-progress-fill { background: var(--grad-future); }

.tl-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
}

.tl-progress-num {
  font-family: var(--num-font);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

/* === Universal Card with Stack of Big Numbers === */
.univ-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.univ-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 16px 32px rgba(0, 0, 0, 0.12),
    0 0 0 1px var(--accent);
}

.univ-card.in-view { opacity: 1; transform: translateY(0); }

.univ-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 1;
}

.univ-card.active::before { background: var(--grad-active); }
.univ-card.warning::before { background: var(--grad-warning); }
.univ-card.closed::before { background: var(--grad-closed); }
.univ-card.future::before { background: var(--grad-future); }

.univ-card-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  cursor: pointer;
  background: var(--card);
}

.univ-card-emoji {
  font-size: 32px;
  line-height: 1;
  margin-right: 16px;
  flex-shrink: 0;
}

.univ-card-title-block {
  flex: 1;
  min-width: 0;
}

.univ-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.univ-card-body {
  padding: 0 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.univ-desc {
  font-family: var(--font-accent);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-style: italic;
}

.univ-stats {
  display: flex;
  gap: 16px;
  margin: auto 0 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.univ-stat { flex: 1; }

.univ-stat-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  font-weight: 600;
}

.univ-stat-value {
  font-family: var(--num-font);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.univ-stat-value.closed { background: var(--grad-closed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.univ-stat-value.warning { background: var(--grad-warning); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.univ-stat-value.active { background: var(--grad-active); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* === Dashboard Stat Cards (Big Numbers) === */
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.dash-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
}

.dash-stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.dash-stat.open::before { background: var(--grad-active); }
.dash-stat.warning::before { background: var(--grad-warning); }
.dash-stat.closed::before { background: var(--grad-closed); }

.dash-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dash-stat-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 600;
}

.dash-stat-num {
  font-family: var(--num-font);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.dash-stat.open .dash-stat-num {
  background: var(--grad-active);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-stat.warning .dash-stat-num {
  background: var(--grad-warning);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-stat.closed .dash-stat-num {
  background: var(--grad-closed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-stat-lbl {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 500;
}

/* === Hero Glass Blobs === */
.hero-glass-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.hero-glass-blob {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: glass-float 20s ease-in-out infinite;
}

.hero-glass-blob.green {
  background: radial-gradient(circle, rgba(0, 200, 83, 0.4) 0%, transparent 70%);
  top: 10%;
  left: 5%;
}

.hero-glass-blob.gold {
  background: radial-gradient(circle, rgba(184, 134, 11, 0.4) 0%, transparent 70%);
  top: 20%;
  right: 10%;
  animation-delay: -5s;
}

.hero-glass-blob.brown {
  background: radial-gradient(circle, rgba(139, 69, 19, 0.3) 0%, transparent 70%);
  bottom: 10%;
  left: 40%;
  animation-delay: -10s;
}

@keyframes glass-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -80px) scale(1.15); }
  66% { transform: translate(-40px, 60px) scale(0.9); }
}

.hero-container { position: relative; z-index: 1; }

/* === Responsive === */
@media (width <= 900px) {
  .tl-card { grid-template-columns: 1fr; }
  .tl-age-block {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
  }
  .tl-age-num { font-size: 32px; }
  .tl-status-block { border-left: none; border-top: 1px solid var(--border); }
}

@media (width <= 768px) {
  .tl-stack { gap: 16px; }
  .tl-content-block { padding: 20px 20px; }
  .tl-title { font-size: 18px; }
  .univ-stats { flex-direction: column; gap: 12px; }
  .dash-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-stat-num { font-size: 32px; }
}

@media (width <= 480px) {
  .dash-stat-grid { grid-template-columns: 1fr; }
}