:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #0073b8;
  --brand-dark: #005a92;
  --brand-soft: #e7f3fb;
  --android: #3ddc84;
  --windows: #0078d4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111a2b;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: #1f2a3d;
    --brand: #3d9ad6;
    --brand-dark: #2b7eb4;
    --brand-soft: #0d2c40;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans", "Noto Sans SC", "Noto Sans JP", "Microsoft YaHei", "Yu Gothic UI", "Meiryo", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(100, 116, 139, 0.12);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

.container {
  width: min(1040px, 100% - 2rem);
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 0.45rem 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  display: block;
  height: 72px;
  width: auto;
}
.logo-on-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .logo-on-light { display: none; }
  .logo-on-dark { display: block; }
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav { display: flex; gap: 1.25rem; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover { color: var(--text); }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-active {
  background: var(--brand);
  color: #fff;
}
.lang-switch button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 1px;
}

html[lang^="zh"] .eyebrow,
html[lang^="ja"] .eyebrow {
  letter-spacing: 0.08em;
}

/* Hero */
.hero {
  padding: 4rem 0 2.5rem;
  background:
    radial-gradient(900px 300px at 10% -20%, var(--brand-soft), transparent 70%),
    radial-gradient(700px 300px at 100% 0%, rgba(0, 120, 212, 0.12), transparent 70%);
}
.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.lead {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* App cards */
.apps-section { padding: 1rem 0 2rem; }
.app-list { display: grid; gap: 1.5rem; }

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.app-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 1.75rem 1rem;
}
.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}
.app-title h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.01em; }
.app-tagline { margin: 0.15rem 0 0; color: var(--muted); }
.app-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.chip {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
@media (prefers-color-scheme: dark) { .chip { color: var(--brand); } }
.chip-muted { background: rgba(100, 116, 139, 0.14); color: var(--muted); }

.app-body { padding: 0 1.75rem 1.75rem; }
.app-desc { margin: 0 0 1.25rem; color: var(--muted); max-width: 720px; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.dl-option {
  position: relative;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
}
.badge {
  position: absolute;
  top: -0.7rem;
  left: 1rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}

.dl-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  background: var(--brand);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
.dl-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.dl-btn:active { transform: translateY(0); }
.dl-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
.dl-btn.is-recommended { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.dl-btn-text { display: flex; flex-direction: column; line-height: 1.25; }
.dl-btn-title { font-weight: 700; font-size: 1rem; }
.dl-btn-sub { font-size: 0.8rem; opacity: 0.85; }

.dl-details {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* OS icons (inline SVG masks) */
.os-icon {
  flex: none;
  width: 26px;
  height: 26px;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.os-android {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.6 9.48l1.84-3.18c.16-.31.04-.69-.26-.85a.637.637 0 0 0-.83.22l-1.88 3.24a11.43 11.43 0 0 0-8.94 0L5.65 5.67a.643.643 0 0 0-.87-.2c-.28.18-.37.54-.22.83L6.4 9.48A10.81 10.81 0 0 0 1 18h22a10.81 10.81 0 0 0-5.4-8.52zM7 15.25a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5zm10 0a1.25 1.25 0 1 1 0-2.5 1.25 1.25 0 0 1 0 2.5z'/%3E%3C/svg%3E");
}
.os-windows {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 5.5l7.5-1v7H3zm8.5-1.2L21 3v8.5h-9.5zM3 12.5h7.5v7L3 18.5zm8.5 0H21V21l-9.5-1.3z'/%3E%3C/svg%3E");
}
.os-macos, .os-ios {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M16.37 12.7c-.03-2.6 2.13-3.85 2.22-3.91-1.21-1.77-3.09-2.01-3.76-2.04-1.6-.16-3.12.94-3.93.94-.81 0-2.06-.92-3.39-.9-1.74.03-3.35 1.01-4.25 2.57-1.81 3.14-.46 7.8 1.3 10.35.86 1.25 1.89 2.65 3.24 2.6 1.3-.05 1.79-.84 3.36-.84 1.57 0 2.01.84 3.39.81 1.4-.02 2.29-1.27 3.14-2.52.99-1.45 1.4-2.85 1.42-2.92-.03-.01-2.72-1.04-2.74-4.14zM13.8 5.06c.72-.87 1.2-2.08 1.07-3.28-1.03.04-2.28.69-3.02 1.56-.66.77-1.24 2-1.09 3.18 1.15.09 2.33-.59 3.04-1.46z'/%3E%3C/svg%3E");
}
.os-linux {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E");
}

/* Help */
.help-section { padding: 1rem 0 3rem; }
.help-section h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.help-card h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.help-card h3 .os-android { color: var(--android); }
.help-card h3 .os-windows { color: var(--windows); }
.help-card ol { margin: 0; padding-left: 1.25rem; color: var(--muted); }
.help-card li { margin: 0.3rem 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.muted { color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 2rem; }

/* Responsive */
@media (max-width: 640px) {
  .app-head { grid-template-columns: auto 1fr; }
  .app-meta { grid-column: 1 / -1; justify-content: flex-start; }
  .brand-logo { height: 58px; }
  .nav { display: none; }
  .header-actions { gap: 0; }
  .lang-switch button { padding: 0.28rem 0.5rem; }
  .hero { padding: 2.5rem 0 1.5rem; }
}
