:root {
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  padding: 14px 14px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1e3a8a 100%);
  color: #ffffff;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.85; }
}

.lang-switcher {
  display: flex;
  gap: 3px;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px;
  border-radius: 8px;
  flex-shrink: 0;
}

.lang-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: #ffffff;
  color: #0f172a;
}

.main-title {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 12.5px;
  color: #cbd5e1;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.section-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* Hero / download */
.hero-card {
  padding: 18px 16px 16px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.app-icon {
  width: 86px;
  height: 86px;
  border-radius: 20px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  background: #0f172a;
}

.app-info {
  min-width: 0;
}

.app-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.app-category {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 6px;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-ghost:hover {
  background: #f8fafc;
}

.full-width {
  width: 100%;
}

.progress-wrap {
  margin-top: 12px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}

.progress-fill {
  height: 100%;
  width: 35%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #0ea5e9);
  animation: indeterminate 1.1s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(390%); }
}

.progress-wrap p {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 7px;
}

.download-hint {
  text-align: center;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Device card */
.device-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.device-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eff6ff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-card.is-ios .device-icon {
  background: #fef2f2;
  color: #dc2626;
}

.device-copy {
  flex: 1;
  min-width: 0;
}

.device-copy h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.device-copy p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill.ok {
  background: #ecfdf5;
  color: #059669;
}

.status-pill.bad {
  background: #fef2f2;
  color: #dc2626;
}

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.feature-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #eff6ff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.feature-item h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.feature-item p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Stats */
.stats-hero {
  text-align: center;
}

.total-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.total-number {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.split-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.progress-track.split {
  height: 10px;
  display: flex;
}

.progress-track.split .progress-fill {
  animation: none;
  width: auto;
}

.progress-fill.blue { background-color: #1d4ed8; }
.progress-fill.amber { background-color: #d97706; }

.app-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  padding-top: 4px;
}

/* iOS overlay */
.overlay-screen {
  position: fixed;
  inset: 0;
  background: #0f172a;
  color: #ffffff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.overlay-card {
  background: #ffffff;
  color: var(--text-primary);
  max-width: 400px;
  width: 100%;
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.icon-badge {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.icon-badge.blocked {
  background: #fef2f2;
  color: #dc2626;
}

.overlay-card h2 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
}

.overlay-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.device-chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 16px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  z-index: 10000;
  max-width: calc(100vw - 40px);
  text-align: center;
}

@media (max-width: 380px) {
  .feature-grid { grid-template-columns: 1fr; }
  .app-icon { width: 72px; height: 72px; border-radius: 17px; }
  .brand-title { font-size: 10px; }
}
