:root {
  --fp-primary: #153c67;
  --play-green: #01875f;
  --play-green-dark: #016b4c;
  --ink: #202124;
  --muted: #5f6368;
  --line: #e8eaed;
  --bg: #ffffff;
  --chip: #f1f3f4;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", "Noto Sans SC",
    "Source Han Sans SC", "WenQuanYi Micro Hei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
a { text-decoration: none; }

/* ---- Home hero ---- */
.hero {
  background: #f8f9fa;
  color: #000;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-weight: 700; }
.hero .lead { opacity: 1; }

/* ---- App cards (home) ---- */
.app-card {
  border: 1px solid var(--line); border-radius: 20px; background: #fff;
  transition: box-shadow .2s ease, transform .2s ease; height: 100%;
}
.app-card:hover {
  box-shadow: 0 8px 24px rgba(60,64,67,.15); transform: translateY(-2px);
}
.app-card .icon {
  width: 88px; height: 88px; border-radius: 20px; flex: 0 0 auto;
}
.app-card .icon img { width: 100%; height: 100%; border-radius: 20px; object-fit: cover; }
.app-card .fw-semibold { font-size: 1.3rem; }
.app-card .rating-inline { font-size: .98rem; }
.rating-inline { color: var(--muted); font-size: .85rem; }
.chip {
  display: inline-block; background: var(--chip); color: var(--muted);
  border-radius: 999px; padding: 2px 10px; font-size: .75rem;
}

/* ---- App detail header ---- */
.app-hero-icon {
  width: 96px; height: 96px; border-radius: 22px; flex: 0 0 auto;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.app-hero-icon img { width: 100%; height: 100%; border-radius: 22px; object-fit: cover; }
.app-title { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.app-dev { color: var(--fp-primary); font-weight: 500; }

/* ---- Store buttons (Android / iOS) ---- */
.btn-store {
  display: inline-flex; align-items: center; justify-content: center;
  background: #343a40; color: #fff; border-radius: 10px; padding: 10px 22px; font-weight: 600;
}
.btn-store:hover { background: #23272b; color: #fff; }
.btn-store.is-recommended { background: var(--play-green); }
.btn-store.is-recommended:hover { background: var(--play-green-dark); }
.btn-store.dimmed { background: #868b91; color: #fff; }
.btn-store.dimmed:hover { background: #6c757d; color: #fff; }
.store-hint { color: var(--muted); }

/* ---- Screenshots strip ---- */
.shots {
  display: flex; gap: 12px; overflow-x: auto; padding: 6px 2px 16px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.shots .shot {
  flex: 0 0 auto; height: 380px; border-radius: 16px;
  border: 1px solid var(--line); scroll-snap-align: start; overflow: hidden;
}
.shots .shot svg { height: 100%; width: auto; display: block; }
.shots .shot img { height: 100%; width: auto; display: block; }

/* ---- Sections ---- */
.section { padding: 22px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 1.6rem; font-weight: 600; margin-bottom: 1rem; }
.about-text { color: #3c4043; line-height: 1.6; }
.legal-links { gap: 12px; align-items: center; }
.legal-links a { color: var(--muted); font-weight: 500; }
.legal-links a:hover { text-decoration: underline; }
.legal-sep { color: var(--line); user-select: none; }

/* ---- Footer ---- */
.fp-footer { background: #f8f9fa; border-top: 1px solid var(--line); color: var(--muted); }

/* ---- Responsive ---- */
@media (max-width: 767.98px) {
  .app-title { font-size: 1.5rem; }
  .app-hero-icon { width: 72px; height: 72px; border-radius: 18px; }
  .app-hero-icon img { border-radius: 18px; }
  .shots .shot { height: 300px; }
  .legal-links { flex-direction: column; align-items: flex-start; gap: 8px; }
  .legal-sep { display: none; }
}

/* About text clamp toggle */
.about-text.clamped {
  max-height: 120px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
          mask-image: linear-gradient(180deg, #000 60%, transparent);
}
.about-text.expanded { -webkit-mask-image: none; mask-image: none; }
#aboutToggle { color: var(--fp-primary); font-weight: 600; }
