/* Design 1: True Phone Home Screen (手机原生桌面 — 暗夜樱粉壁纸版) */
:root {
  color-scheme: dark;
  --bg: #150b14;
  --header-bg: rgba(21, 11, 20, 0.64);
  --divider: rgba(249, 168, 212, 0.18);
  --text: #fdf2f8;
  --text-muted: #d8b4cc;
  --icon-bg: #261624;
  --icon-shadow: 0 14px 28px -6px rgba(0, 0, 0, 0.65);
  --icon-shadow-hover: 0 22px 38px -8px rgba(236, 72, 153, 0.35);
  --icon-ring: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  --accent: #f472b6;
  --focus-ring: #f472b6;
  --header-height: 56px;
  --container-width: 480px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Soft Sakura Pink & Lilac Phone Wallpaper Mesh */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(640px 540px at 14% 10%, rgba(236, 72, 153, 0.24), transparent 66%),
    radial-gradient(620px 520px at 88% 18%, rgba(192, 132, 252, 0.18), transparent 66%),
    radial-gradient(640px 520px at 50% 88%, rgba(244, 114, 182, 0.16), transparent 68%);
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.header-inner {
  max-width: var(--container-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(236, 72, 153, 0.34));
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand:hover .brand-mark {
  transform: scale(1.08) rotate(-4deg);
}

.page-main {
  flex: 1;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px 18px 64px;
}

.directory {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.category-section {
  scroll-margin-top: calc(var(--header-height) + 18px);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0 10px;
}

.category-header::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--divider), transparent);
}

.category-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
}

.category-anchor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.category-anchor::before {
  content: "";
  width: 4px;
  height: 13px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f472b6, #e879f9);
}

.category-hash {
  color: var(--accent);
  opacity: 0;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.category-anchor:hover .category-hash,
.category-anchor:focus-visible .category-hash {
  opacity: 1;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 10px;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.app-card:active {
  transform: scale(0.92);
}

.app-icon {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 17px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-bg);
  box-shadow: var(--icon-shadow);
  transition:
    transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.22s ease;
}

.app-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: var(--icon-ring);
  pointer-events: none;
}

.app-card:hover .app-icon {
  transform: translateY(-4px) scale(1.07);
  box-shadow: var(--icon-shadow-hover);
}

.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-icon-letter {
  font-size: 24px;
  font-weight: 700;
}

.app-name {
  margin-top: 8px;
  width: 100%;
  text-align: center;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 400px) {
  .app-icon {
    width: 58px;
    height: 58px;
    border-radius: 15px;
  }

  .app-name {
    font-size: 11.5px;
  }
}

.site-footer {
  padding: 16px 0 26px;
}

.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
