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

:root {
  --jade-50: #edfcf4; --jade-100: #d4f7e3; --jade-200: #acedcb;
  --jade-400: #34c681; --jade-500: #10b068; --jade-600: #058d54;
  --jade-700: #047146; --jade-900: #064a30; --jade-950: #02291b;
  --surf-50: #f6f8f7; --surf-100: #eaefec; --surf-200: #d4dfd9;
  --surf-300: #a8bfb3; --surf-400: #749488; --surf-500: #59756b;
  --surf-600: #455d54; --surf-700: #384d44; --surf-800: #2a3a33;
  --surf-900: #1a2420; --surf-950: #0d1512;
  --bg: #f0f4f2; --bg-panel: rgba(255,255,255,0.88); --border: rgba(0,0,0,0.07);
  --border-hover: rgba(0,0,0,0.12); --text: var(--surf-900); --text-2: var(--surf-500);
  --text-3: var(--surf-400); --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.06), 0 20px 60px rgba(0,0,0,0.08);
  --radius: 16px; --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080c0a; --bg-panel: rgba(20,30,26,0.82); --border: rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.12); --text: var(--surf-100); --text-2: var(--surf-400);
    --text-3: var(--surf-500); --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 6px 24px rgba(0,0,0,0.2);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4), 0 20px 60px rgba(0,0,0,0.5);
    color-scheme: dark;
  }
}

body {
  background: var(--bg); color: var(--text);
  font-family: "Be Vietnam Pro", -apple-system, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.page { max-width: 640px; margin: 0 auto; padding: 40px 20px; width: 100%; flex: 1; }

/* ─── Header ─── */
.dl-header { text-align: center; margin-bottom: 36px; animation: fadeIn 0.5s ease both; }
.dl-icon {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px;
  background: linear-gradient(145deg, var(--jade-600), var(--jade-700));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(5,141,84,0.25), inset 0 1px 0 rgba(255,255,255,0.1);
}
.dl-icon svg { width: 32px; height: 32px; color: white; }
.dl-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.dl-title span { color: var(--jade-500); }
.dl-subtitle { font-size: 14px; color: var(--text-2); line-height: 1.5; }

/* ─── Detected OS hero ─── */
.dl-hero {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-bottom: 16px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: 0.08s;
  backdrop-filter: blur(20px);
}
.dl-hero::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--jade-400), var(--jade-600), var(--jade-400));
}
.dl-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--jade-50); color: var(--jade-700); border: 1px solid var(--jade-200);
  padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 600;
  margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em;
}
@media (prefers-color-scheme: dark) {
  .dl-hero-badge { background: rgba(16,176,104,0.1); color: var(--jade-400); border-color: rgba(16,176,104,0.2); }
}
.dl-hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--jade-500);
  animation: pulse 2s ease-in-out infinite;
}
.dl-hero-os { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.dl-hero-os-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surf-100); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
@media (prefers-color-scheme: dark) { .dl-hero-os-icon { background: rgba(255,255,255,0.04); } }
.dl-hero-os-info h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.dl-hero-os-info p { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.dl-hero-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 20px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--jade-500), var(--jade-600));
  color: white; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  box-shadow: 0 1px 2px rgba(5,141,84,0.2), 0 4px 12px rgba(5,141,84,0.15);
}
.dl-hero-btn:hover {
  background: linear-gradient(180deg, var(--jade-400), var(--jade-500));
  box-shadow: 0 2px 4px rgba(5,141,84,0.25), 0 8px 24px rgba(5,141,84,0.2);
  transform: translateY(-1px);
}
.dl-hero-btn:active { transform: translateY(0); }
.dl-hero-btn svg { width: 18px; height: 18px; }
.dl-hero-meta {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 12px; font-size: 11px; color: var(--text-3);
}
.dl-hero-meta span { display: flex; align-items: center; gap: 4px; }
.dl-hero-meta svg { width: 12px; height: 12px; }

/* ─── Other platforms ─── */
.dl-other-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3); margin: 24px 0 12px;
  display: flex; align-items: center; gap: 8px;
  animation: fadeIn 0.5s ease both; animation-delay: 0.15s;
}
.dl-other-title::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.dl-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: 0.2s;
}
@media (max-width: 480px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-card {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  cursor: pointer; transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
  backdrop-filter: blur(20px);
}
.dl-card:hover {
  border-color: var(--jade-400); box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.dl-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dl-card-icon { font-size: 24px; flex-shrink: 0; }
.dl-card-name { font-size: 13px; font-weight: 600; }
.dl-card-arch { font-size: 11px; color: var(--text-3); }
.dl-card-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 12px;
  font-weight: 500; font-family: inherit; cursor: pointer;
  transition: all 0.2s;
}
.dl-card-btn:hover { background: var(--jade-50); color: var(--jade-700); border-color: var(--jade-200); }
@media (prefers-color-scheme: dark) {
  .dl-card-btn:hover { background: rgba(16,176,104,0.08); color: var(--jade-400); border-color: rgba(16,176,104,0.2); }
}
.dl-card-btn svg { width: 14px; height: 14px; }

/* ─── Web viewer banner ─── */
.dl-web {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 18px;
  margin-top: 10px; display: flex; align-items: center; gap: 14px;
  transition: all 0.2s; cursor: pointer; text-decoration: none; color: inherit;
  animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both;
  animation-delay: 0.25s;
  backdrop-filter: blur(20px);
}
.dl-web:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.dl-web-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(145deg, var(--surf-200), var(--surf-100));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .dl-web-icon { background: linear-gradient(145deg, var(--surf-800), var(--surf-900)); }
}
.dl-web-info { flex: 1; }
.dl-web-info h4 { font-size: 13px; font-weight: 600; }
.dl-web-info p { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.dl-web-arrow { color: var(--text-3); font-size: 18px; }

/* ─── Features ─── */
.dl-features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 24px;
  animation: fadeIn 0.5s ease both; animation-delay: 0.3s;
}
@media (max-width: 480px) { .dl-features { grid-template-columns: 1fr; } }
.dl-feat {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px; font-size: 12px; color: var(--text-2);
}
.dl-feat-icon { font-size: 16px; flex-shrink: 0; }

/* ─── Footer ─── */
.dl-footer {
  text-align: center; padding: 20px; font-size: 11px; color: var(--text-3);
  animation: fadeIn 0.5s ease both; animation-delay: 0.35s;
}
.dl-footer a { color: var(--jade-500); text-decoration: none; }
.dl-footer a:hover { text-decoration: underline; }

/* ─── Animations ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
