:root {
  --bg: #ffffff;
  --page-bg: #eceff1;
  --text-primary: #1f1f1f;
  --text-secondary: #5f6368;
  --text-tertiary: #80868b;
  --accent: #01875f;
  --accent-dark: #016a4a;
  --border: #e8eaed;
  --star: #ff9800;
  --chip-bg: #f1f3f4;
  --frame-width: 430px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--page-bg);
}

body {
  font-family: Roboto, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

.app-frame {
  width: 100%;
  max-width: var(--frame-width);
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 24px rgba(0,0,0,0.08);
}

/* ---------- Header block ---------- */
.content { padding-bottom: 32px; }

.header-block { padding: 20px 16px 12px; }

.icon-title-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.title-col { min-width: 0; padding-top: 2px; }

.title-col h1 {
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 2px;
  line-height: 1.3;
}

.dev-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 4px;
}
.dev-link svg { width: 14px; height: 14px; }

.ad-info { font-size: 12px; color: var(--text-secondary); }

/* stats row */
.stats-row {
  display: flex;
  align-items: stretch;
  margin: 20px 0 16px;
  text-align: center;
}

.stat-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  cursor: pointer;
  color: var(--text-primary);
}

.stat-value {
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-value svg { width: 16px; height: 16px; }
.stat-value .star-icon { color: var(--star); font-size: 14px; }

.age-badge {
  border: 1.5px solid var(--text-secondary);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 600;
}

.stat-label { font-size: 11px; color: var(--text-secondary); }

.stat-divider { width: 1px; background: var(--border); margin: 2px 0; }

/* install button */
.install-row { display: flex; align-items: center; gap: 12px; }

.btn-install {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 100%;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-install:active { background: var(--accent-dark); }
.btn-install[disabled] { opacity: 0.85; }

.download-progress {
  display: none;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
  margin-top: 10px;
}
.download-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

.download-info { font-size: 11px; color: var(--text-secondary); margin-top: 8px; }

/* ---------- Screenshots ---------- */
.screenshots-section { padding: 4px 0 20px; }
.screenshots {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px;
  scrollbar-width: none;
}
.screenshots::-webkit-scrollbar { display: none; }

.screenshot {
  flex-shrink: 0;
  width: 140px;
  height: 280px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* ---------- Section generic ---------- */
.section-pad { padding: 20px 16px; }
.divider { height: 8px; background: var(--page-bg); }

h2.section-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.see-all {
  font-size: 13px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 2px;
}
.see-all svg { width: 16px; height: 16px; }

/* ---------- About ---------- */
.about-section { padding: 20px 16px; }
.description {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-primary);
  margin: 0;
  white-space: pre-line;
}
.description.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.more-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 0 4px;
  cursor: pointer;
}

.tag-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
  scrollbar-width: none;
}
.tag-row::-webkit-scrollbar { display: none; }
.tag-chip {
  flex-shrink: 0;
  background: var(--chip-bg);
  color: var(--text-primary);
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
}

/* ---------- Data safety ---------- */
.datasafety-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.datasafety-row svg { width: 28px; height: 28px; flex-shrink: 0; color: var(--text-secondary); }
.datasafety-row p { font-size: 13px; line-height: 1.5; color: var(--text-primary); margin: 0; flex: 1; }
.datasafety-row .chevron { width: 20px; height: 20px; color: var(--text-secondary); flex-shrink: 0; }
.datasafety-link { display: block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--accent); }

/* ---------- Ratings ---------- */
.ratings-summary {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}
.score-block { text-align: center; flex-shrink: 0; }
.score-num { font-size: 44px; font-weight: 400; line-height: 1; }
.score-stars { color: var(--star); font-size: 14px; margin: 6px 0 4px; }
.score-count { font-size: 11px; color: var(--text-secondary); }

.bars { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-secondary); }
.bar-track { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.bar-fill { height: 100%; background: var(--star); }

/* ---------- What's new ---------- */
.whatsnew-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.whatsnew-section .description { font-size: 13.5px; }

/* ---------- App info ---------- */
.info-list { display: flex; flex-direction: column; }
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-secondary); }
.info-row span:last-child { color: var(--text-primary); text-align: right; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #323232;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: calc(var(--frame-width) - 48px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
