/* ══ PAGE 1: HOME — 8 Category Cards ══ */
#p-home {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
#p-home::-webkit-scrollbar { width: 3px; }
#p-home::-webkit-scrollbar-track { background: transparent; }
#p-home::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); 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: 600; 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;
  background: linear-gradient(135deg, #c6a84b 0%, #f0dca0 45%, #c6a84b 65%, #a08530 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: nixShimmer 4s ease-in-out infinite 1.5s;
}
@keyframes nixShimmer {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}
.map-sub {
  font-family: var(--mono); font-size: 11px; font-weight: 300;
  letter-spacing: .15em; color: var(--text-tertiary);
  grid-column: 1 / -1; margin: 4px 0 -4px;
  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;
  margin-bottom: 8px;
  position: relative; overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 18px 22px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  /* 🌟 替换基础动效：赋予四阶贝塞尔弹簧属性 */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
  /* 🌟 Apple Masterclass 1: 经典的内高光配合外倒影，拉开空间深度 */
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.15);
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  opacity: 0; animation: cardIn 0.45s ease forwards;
}
.continue-card:hover {
  border-color: var(--card-border-hover);
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}
.continue-card:active,
.continue-card.pressing {
  /* 🌟 克制的物理下压：幅度极小但带有手感，属于”高密度、高阻尼”的机械反馈 */
  transform: scale(0.98) !important;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.1s ease;
}
.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 { width: 26px; height: 26px; }
.cc-icon svg { width: 100%; height: 100%; }
.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: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 22px 20px 20px;
  cursor: pointer;
  display: flex; flex-direction: column;
  /* 🌟 同步赋予阻尼动画 */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
  /* 🌟 Apple Masterclass 1: 给主副卡片装配统一的水晶折射光影 */
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.15);
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  opacity: 0; animation: cardIn 0.45s ease forwards;
}
.hc:hover {
  border-color: var(--card-border-hover);
  background: var(--card-bg-hover);
  transform: translateY(-2px);
}
.hc:active,
.hc.pressing {
  /* 🌟 克制的重力下压 */
  transform: scale(0.98) !important;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.1s ease;
}
.hc-aurora {
  position: absolute; top: -40px; right: -40px;
  width: 130px; height: 130px;
  border-radius: 50%; filter: blur(45px);
  opacity: 0.15; pointer-events: none;
  transition: opacity 0.3s;
}
.hc:hover .hc-aurora { opacity: 0.22; }

.hc-icon { width: 32px; height: 32px; display: block; margin-bottom: 14px; }
.hc-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 6px currentColor); opacity: 0.85; }
.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;
}
/* 🌟 Apple Masterclass 3: 隐约可见的光子微光 (Restrained Photon) */
.hc-progress-fill::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -1px;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); /* 微微透明的实体点 */
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.35); /* 大幅减弱的光晕 */
  opacity: 0.7;
}
.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); }
