/* ══ PAGE 1: HOME — 8 Category Cards ══ */
#p-home {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background-color: transparent;
}
#p-home::-webkit-scrollbar { width: 3px; }
#p-home:-webkit-scrollbar-track { background: transparent; }
#p-home::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 3px; }

/* Starfield (仅方案 A 生效；方案 B 时可在 JS 中注释掉 starfield 初始化) */
#starfield { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* 背景已迁移到共享 #space-bg 层 */


#home-header {
  position: relative; z-index: 1;
  padding: max(env(safe-area-inset-top), 44px) 24px 0;
  max-width: 980px; margin: 0 auto;
}
.map-eyebrow {
  font-family: var(--mono); font-size: 10px; font-weight: 300;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
  opacity: 0; animation: fadeUp 0.6s ease forwards 0.15s;
}
.map-title {
  font-family: var(--serif);
  font-size: clamp(34px, 9vw, 50px);
  font-weight: 400; line-height: 1.05;
  color: var(--text-primary); letter-spacing: -0.02em;
  opacity: 0; animation: fadeUp 0.7s ease forwards 0.28s;
}
.map-title em { font-style: italic; font-weight: 300; color: #c6a84b; }
.map-sub {
  font-family: var(--mono); font-size: 11px; font-weight: 300;
  letter-spacing: .15em; color: var(--text-tertiary); margin-top: 8px;
  opacity: 0; animation: fadeUp 0.6s ease forwards 0.4s;
}

#stats-bar {
  position: relative; z-index: 1;
  max-width: 980px; margin: 20px auto 0; padding: 0 24px;
  display: flex; gap: 28px;
  opacity: 0; animation: fadeUp 0.6s ease forwards 0.48s;
}
.stat-item { display: flex; align-items: baseline; gap: 6px; }
.stat-num { font-family: var(--mono); font-size: 20px; font-weight: 400; color: var(--text-primary); }
.stat-label { font-family: var(--mono); font-size: 10px; font-weight: 300; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; }

/* ── Category Grid ── */
#home-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 24px 24px max(env(safe-area-inset-bottom), 48px);
  max-width: 980px; margin: 0 auto;
}
@media (min-width: 600px) { #home-grid { gap: 16px; } }
@media (min-width: 960px) { #home-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }

/* ── Continue Card ── */
.continue-card {
  grid-column: 1 / -1; /* 横跨所有列，保证完美适配任何宽度的 grid */
  margin-bottom: 8px;
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1), border-color 0.25s, background 0.25s;
  -webkit-user-select: none; user-select: none;
  opacity: 0; animation: cardIn 0.45s ease forwards;
}
.continue-card:active { transform: scale(0.97); }
.continue-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}
.cc-bg {
  position: absolute; top: 0; left: 0; bottom: 0; width: 40%;
  filter: blur(30px); opacity: 0.6; pointer-events: none;
}
.cc-left {
  display: flex; align-items: center; gap: 16px; position: relative; z-index: 1;
}
.cc-icon {
  font-size: 26px; 
}
.cc-label {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 4px;
}
.cc-stat {
  font-family: var(--mono); font-size: 11px; font-weight: 300;
  color: var(--text-tertiary); letter-spacing: 0.03em;
}
.cc-right {
  display: flex; align-items: center; gap: 14px; position: relative; z-index: 1;
}
.cc-percent {
  font-family: var(--mono); font-size: 16px; font-weight: 400;
}

/* ── Category Card ── */
.hc {
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px 20px 20px;
  cursor: pointer;
  display: flex; flex-direction: column;
  transition: transform 0.28s cubic-bezier(.34, 1.56, .64, 1), border-color 0.25s, background 0.25s;
  -webkit-user-select: none; user-select: none;
  opacity: 0; animation: cardIn 0.45s ease forwards;
}
.hc:active { transform: scale(0.96); }
.hc:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-3px);
}
.hc-aurora {
  position: absolute; top: -40px; right: -40px;
  width: 130px; height: 130px;
  border-radius: 50%; filter: blur(45px);
  opacity: 0.18; pointer-events: none;
  transition: opacity 0.3s;
}
.hc:hover .hc-aurora { opacity: 0.28; }

.hc-icon { font-size: 32px; display: block; margin-bottom: 14px; }
.hc-name {
  font-family: var(--serif); font-size: 20px; font-weight: 600;
  line-height: 1.2; margin-bottom: 6px;
}
.hc-desc {
  font-family: var(--mono); font-size: 10px; font-weight: 300;
  letter-spacing: .06em; color: var(--text-muted);
  margin-bottom: 16px;
}
.hc-footer {
  margin-top: auto;
  padding-top: 12px;
}
.hc-progress {
  position: relative; height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px; overflow: hidden; margin-bottom: 10px;
}
.hc-progress-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  border-radius: 2px;
  transition: width 0.9s cubic-bezier(.16, 1, .3, 1);
  width: 0;
}
.hc-bottom {
  display: flex; align-items: center; justify-content: space-between;
}
.hc-stat {
  font-family: var(--mono); font-size: 11px; font-weight: 300;
  letter-spacing: .04em; color: var(--text-tertiary);
}
.hc-arrow {
  font-size: 16px; color: var(--text-muted);
  transition: color 0.25s, transform 0.25s;
}
.hc:hover .hc-arrow { color: var(--text-tertiary); transform: translateX(3px); }
