:root {
  color-scheme: light dark;
  --bg: #f4f6fa;
  --bg-card: #ffffff;
  --text: #1a2332;
  --text-muted: #5c6b82;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --border: rgba(26, 35, 50, 0.1);
  --shadow: 0 8px 32px rgba(26, 35, 50, 0.08);
  --shadow-hover: 0 12px 40px rgba(37, 99, 235, 0.15);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  --max: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-card: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #58a6ff;
    --accent-soft: rgba(88, 166, 255, 0.14);
    --border: rgba(240, 246, 252, 0.1);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 40px rgba(88, 166, 255, 0.12);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-soft), transparent),
    var(--bg);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* —— Home —— */

.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.lead {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.os-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1rem;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.os-grid a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.os-grid a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.os-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 10px;
  color: #fff;
}

.os-android .os-icon { background: linear-gradient(135deg, #3ddc84, #1b8f4e); }
.os-ios .os-icon { background: linear-gradient(135deg, #555, #1a1a1a); }
.os-windows .os-icon { background: linear-gradient(135deg, #0078d4, #005a9e); }
.os-macos .os-icon { background: linear-gradient(135deg, #6e6e73, #424245); }
.os-linux .os-icon { background: linear-gradient(135deg, #fcc624, #e8a317); color: #1a1a1a; }

.os-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

/* —— Subpages —— */

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.back:hover {
  color: var(--accent);
}

.page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-head .os-icon {
  width: 3.25rem;
  height: 3.25rem;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.page-head h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.prose {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem;
}

.prose p {
  margin: 0;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.notice::before {
  content: "ℹ";
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-card);
  border-radius: 50%;
}

/* —— Guides —— */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.15rem;
  margin-bottom: 1.25rem;
}

.intro p {
  margin: 0 0 0.65rem;
}

.intro p:last-child {
  margin-bottom: 0;
}

.sub-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: var(--accent-soft);
}

.toc-apps .toc-title {
  margin: 0 0 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.toc-apps ol {
  margin: 0;
  padding-left: 1.25rem;
}

.toc-apps a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.toc-apps a:hover {
  text-decoration: underline;
}

.toc-recommended {
  font-weight: 650;
}

.guides {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.app-guide {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.2rem 1.5rem;
}

.app-guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.app-guide h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 650;
}

.app-guide h3 {
  margin: 1.15rem 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.app-guide p {
  margin: 0 0 0.65rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-block;
  padding: 0.2em 0.55em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.badge-recommended {
  color: #0d3d1a;
  background: #d4f5dc;
  border: 1px solid #9ed9ad;
}

.badge-free {
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.badge-paid {
  color: #5c3d00;
  background: #fff3cd;
  border: 1px solid #e6c878;
}

@media (prefers-color-scheme: dark) {
  .badge-recommended {
    color: #b8f0c8;
    background: #1a3d24;
    border-color: #2d6b3f;
  }
  .badge-paid {
    color: #ffe08a;
    background: #3d3000;
    border-color: #6b5500;
  }
}

.steps {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.steps li {
  margin-bottom: 0.45rem;
}

.steps.compact li {
  margin-bottom: 0.35rem;
}

.issues {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-figure {
  margin: 1rem 0 1.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}

.step-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.step-figure figcaption {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.fig-credit {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  opacity: 0.85;
}

.os-icon-svg {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.45rem;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  flex-shrink: 0;
}

.os-grid .os-icon-img {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0.4rem;
  border-radius: 10px;
  color: #fff;
}

.os-android .os-icon-img { background: linear-gradient(135deg, #3ddc84, #1b8f4e); }
.os-ios .os-icon-img { background: linear-gradient(135deg, #555, #1a1a1a); }
.os-windows .os-icon-img { background: linear-gradient(135deg, #0078d4, #005a9e); }
.os-macos .os-icon-img { background: linear-gradient(135deg, #6e6e73, #424245); }
.os-linux .os-icon-img { background: linear-gradient(135deg, #fcc624, #e8a317); color: #1a1a1a; }

.wrap {
  max-width: 44rem;
}

/* —— Common section —— */

.common-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 650;
}

.common-section > p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.priority-list {
  margin: 1rem 0;
  padding-left: 1.35rem;
}

.priority-list li {
  margin-bottom: 0.85rem;
}

.priority-list li strong {
  color: var(--text);
}

.tips-list {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.tips-list li {
  margin-bottom: 0.4rem;
}

.notice-ai {
  padding: 0.9rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--accent-soft);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.notice-ai p {
  margin: 0;
}

.support-card {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.support-card p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.btn-donate {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  transition: opacity 0.15s ease;
}

.btn-donate:hover {
  opacity: 0.9;
}

.contact-line {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-line a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.contact-line a:hover {
  text-decoration: underline;
}
