/* ============================================================
   ailife 门户 · Apple 风格
   亮色为主，支持深色模式；移动端与 PC 端统一
   ============================================================ */

:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --separator: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.14);
  --icon-radius: 22.37%; /* iOS squircle 近似 */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: rgba(28, 28, 30, 0.72);
    --surface-solid: #1c1c1e;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --separator: rgba(255, 255, 255, 0.12);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.65);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 22px calc(28px + env(safe-area-inset-bottom));
}

/* ===== 标题 ===== */
.masthead {
  text-align: center;
  margin-bottom: 52px;
}
.title {
  font-size: clamp(40px, 9vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.subtitle {
  margin-top: 10px;
  font-size: clamp(17px, 3.5vw, 21px);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* ===== 应用网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(28px, 6vw, 56px);
  width: 100%;
  max-width: 560px;
}

.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app-icon {
  width: clamp(84px, 22vw, 108px);
  height: clamp(84px, 22vw, 108px);
  border-radius: var(--icon-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(42px, 11vw, 54px);
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s ease;
  will-change: transform;
}

/* 图标底色（苹果风渐变） */
.icon-fish {
  background: linear-gradient(160deg, #5ac8fa 0%, #007aff 100%);
}
.icon-piano {
  background: linear-gradient(160deg, #30d158 0%, #34c759 55%, #00a25b 100%);
}

.app:hover .app-icon {
  transform: translateY(-6px) scale(1.04);
  box-shadow: var(--shadow-hover);
}
.app:active .app-icon {
  transform: scale(0.96);
  transition-duration: 0.1s;
}

.app-label {
  margin-top: 16px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.app-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 页脚 ===== */
.footer {
  margin-top: auto;
  padding-top: 56px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 大屏时标题与网格更宽松 */
@media (min-width: 768px) {
  .masthead { margin-bottom: 64px; }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .app-icon { transition: none; }
  .app:hover .app-icon,
  .app:active .app-icon { transform: none; }
}
