:root {
  --bg: #0f172a;
  --bg-alt: #16203a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --border: #334155;
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --bg-alt: #eef2f7;
    --surface: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --accent: #0284c7;
    --accent-strong: #0369a1;
    --border: #e2e8f0;
  }
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}

.brand:hover {
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
}

.hero {
  padding: 56px 0 40px;
  text-align: center;
  background: radial-gradient(circle at 50% -20%, rgba(56, 189, 248, 0.15), transparent 60%);
}

.hero h1 {
  font-size: 32px;
}

.hero-tagline {
  margin: 8px 0 6px;
  color: var(--text-muted);
  font-size: 17px;
}

.cta-note {
  font-size: 14px;
  color: var(--text-muted);
}

.section {
  padding: 40px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section h2 {
  font-size: 22px;
  margin-bottom: 20px;
}

.breadcrumb {
  padding: 20px 0 0;
  font-size: 14px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.loading {
  color: var(--text-muted);
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px 0;
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.app-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-icon {
  border-radius: 16px;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.app-card-title h2 {
  font-size: 20px;
}

.app-version {
  color: var(--text-muted);
  font-size: 14px;
}

.app-tagline {
  color: var(--text-muted);
  font-size: 14px;
  flex-grow: 1;
}

.app-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.dot {
  margin: 0 6px;
  opacity: 0.6;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions .btn {
  flex: 1;
  min-width: 120px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #0f172a;
  border-color: transparent;
}

.btn-secondary {
  background: var(--bg-alt);
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.steps {
  padding-left: 22px;
  display: grid;
  gap: 8px;
}

.note {
  margin-top: 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
}

/* App detail page */

.app-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px 0 8px;
}

.app-icon-lg {
  border-radius: 22px;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.app-hero-meta h1 {
  font-size: 28px;
}

.app-hero-meta .app-tagline {
  margin: 4px 0 8px;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
}

.badge-accent {
  background: linear-gradient(135deg, var(--accent), #818cf8);
  color: #0f172a;
  border-color: transparent;
}

.package-name {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.download-panel {
  padding: 20px 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  position: relative;
}

.qr-box {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 18px;
  background: #fff;
  border-radius: var(--radius);
  display: inline-block;
}

.qr-box svg {
  display: block;
}

.qr-hint {
  flex-basis: 100%;
  font-size: 13px;
  color: var(--text-muted);
}

.verify-box {
  flex-basis: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.verify-label {
  flex-basis: 100%;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.verify-hash {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.link-row {
  flex-basis: 100%;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.about-text {
  color: var(--text-muted);
  max-width: 70ch;
}

.features-list {
  list-style: none;
  display: grid;
  gap: 10px;
  padding: 0;
}

.features-list li {
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  position: relative;
  font-size: 15px;
}

.features-list li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  color: var(--accent);
  font-weight: 700;
}

.screenshots {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.screenshots img {
  height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.table-wrap {
  overflow-x: auto;
}

.version-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.version-table th,
.version-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.version-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.version-table td.num,
.version-table th.num {
  text-align: right;
  white-space: nowrap;
}

.version-table .is-current {
  background: rgba(56, 189, 248, 0.08);
}

.changelog-list {
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--text-muted);
}

/* FAQ */

.faq-page h2 {
  margin-top: 32px;
}

.faq-page h2:first-of-type {
  margin-top: 0;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 14px 18px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  font-weight: 400;
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p,
.faq-item ol {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 14px;
}

.faq-item pre,
.code-block {
  margin: 10px 0;
  padding: 12px 14px;
  background: var(--bg-alt);
  border-radius: 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  overflow-x: auto;
  color: var(--text);
}

.changelog summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.changelog summary:hover {
  color: var(--text);
}

.changelog ul {
  margin-top: 8px;
  padding-left: 20px;
  display: grid;
  gap: 4px;
  color: var(--text-muted);
  font-size: 14px;
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

@media (max-width: 600px) {
  .app-hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
