:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;
  --fg: #1d1d1f;
  --fg-2: #6e6e73;
  --line: #e5e5ea;
  --action: #0a66e4;
  --action-fg: #ffffff;
  --card: #ffffff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", "Hiragino Sans GB",
    "Noto Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* Light by default; dark only when chosen with the footer's switch (kept in localStorage). */
html[data-theme="dark"] {
  --bg: #000000;
  --bg-2: #1c1c1e;
  --fg: #f5f5f7;
  --fg-2: #a1a1a6;
  --line: #2c2c2e;
  --action: #2f7cf6;
  --card: #1c1c1e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
p a { color: var(--action); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 34px; line-height: 1.15; font-weight: 700; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 600; }

/* Language: every phrase exists twice; the document's data-lang picks one. */
i.en, i.zh { font-style: normal; }
html[data-lang="en"] .zh, html[data-lang="zh"] .en { display: none; }
html[data-lang="zh"] body { letter-spacing: 0; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(20px, 5vw, 56px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.links { display: flex; align-items: center; gap: 26px; font-size: 14px; color: var(--fg-2); }
.links a:hover { color: var(--fg); }
.lang {
  font: inherit; color: var(--fg-2); background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; cursor: pointer;
}
.lang:hover { color: var(--fg); border-color: var(--fg-2); }
.links .btn.small { padding: 7px 14px; font-size: 13.5px; border-radius: 999px; }
.links .btn.small:hover { transform: none; }
@media (max-width: 760px) { .links a:not([href^="http"]) { display: none; } .links { gap: 16px; } }

/* The notice, first: a full-width band under the nav (free · open source · non-profit). */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
  padding: 10px clamp(20px, 5vw, 56px);
  background: linear-gradient(90deg, color-mix(in srgb, var(--action) 12%, var(--bg)), color-mix(in srgb, #7c5cff 12%, var(--bg)), color-mix(in srgb, #06b6d4 12%, var(--bg)));
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  font-size: 14px; line-height: 1.4; text-align: center; color: var(--fg);
}
.banner strong { color: var(--action); font-weight: 700; letter-spacing: 0.01em; }
.banner span { color: var(--fg-2); }
.banner:hover span { color: var(--fg); }
@media (max-width: 760px) { .banner { font-size: 13px; padding: 9px 16px; } }

/* Hero */
main { max-width: 1120px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
.hero { text-align: center; padding: clamp(72px, 12vw, 136px) 0 40px; }
.eyebrow { margin: 0 0 18px; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--fg-2); text-transform: none; }
.hero h1 { font-size: clamp(32px, 5.4vw, 60px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; }
.lede { max-width: 760px; margin: 26px auto 0; font-size: clamp(18px, 2.1vw, 21px); line-height: 1.5; color: var(--fg-2); }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 16px;
  border: 1px solid var(--line); color: var(--fg); background: var(--bg);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--fg-2); }
.btn.primary { background: var(--action); color: var(--action-fg); border-color: var(--action); }
.btn.primary:hover { filter: brightness(1.06); }
.btn .platform { font-weight: 500; color: inherit; opacity: 0.8; }
.fine { margin: 18px 0 0; font-size: 13px; color: var(--fg-2); }
.stage { margin: clamp(40px, 6vw, 72px) auto 0; max-width: 1040px; }
.stage img {
  width: 100%; border-radius: clamp(12px, 1.6vw, 18px); box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); background: var(--bg-2);
}
.fine code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* Moods strip */
.moods { margin: clamp(48px, 7vw, 80px) auto 0; max-width: 980px; text-align: center; }
.moods img { width: 100%; }
.moods figcaption { margin-top: 16px; font-size: 15px; color: var(--fg-2); }

/* Screens */
.shots {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2.5vw, 28px);
  margin: clamp(56px, 8vw, 96px) 0 0;
}
.shots figure { margin: 0; text-align: center; }
.shots img {
  border-radius: clamp(18px, 3vw, 32px);
  box-shadow: var(--shadow);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--bg-2);
}
.shots figcaption { margin-top: 14px; font-size: 15px; font-weight: 500; color: var(--fg-2); }
@media (max-width: 760px) { .shots { grid-template-columns: repeat(2, 1fr); } }

/* Sections */
section h2 { text-align: center; }

/* What is nanoMuse: a paragraph and a checklist, two columns. */
.what { padding: clamp(80px, 11vw, 140px) 0 0; }
.what .sub { max-width: 780px; font-size: 17.5px; line-height: 1.55; }
.features {
  list-style: none; margin: 44px auto 0; padding: 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 40px;
}
.features li { position: relative; padding: 14px 0 14px 40px; border-bottom: 1px solid var(--line); }
.features li::before {
  content: ""; position: absolute; left: 4px; top: 21px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--action) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path fill="none" stroke="white" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" d="M5 10.5l3.5 3.5L15 6.5"/></svg>') center / 14px no-repeat;
}
.features h3 { font-size: 17px; }
.features p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--fg-2); }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; gap: 0; } }

/* Every device: three columns. */
.devices { padding: clamp(80px, 11vw, 140px) 0 0; }
.cols.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cols.three { grid-template-columns: 1fr; } }

/* Download: numbered ways, each with its buttons. */
.download { padding: clamp(80px, 11vw, 140px) 0 0; }
.ways { list-style: none; margin: 40px auto 0; padding: 0; max-width: 900px; }
.ways li {
  display: grid; grid-template-columns: 44px 1fr; gap: 18px; align-items: start;
  padding: 26px 0; border-top: 1px solid var(--line);
}
.ways li:last-child { border-bottom: 1px solid var(--line); }
.ways .n {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; margin-top: 2px;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--line);
}
.ways h3 { font-size: 20px; }
.ways p { margin: 6px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--fg-2); }
.ways code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; }
.source { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 18px auto 0; max-width: 900px; font-size: 14px; color: var(--fg-2); }
.source .pill { appearance: none; border: 1px solid var(--line); background: var(--surface, transparent); color: var(--fg); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13.5px; cursor: pointer; }
.source .pill.on { border-color: var(--action); color: var(--action); font-weight: 600; }
.source small { flex-basis: 100%; font-size: 13px; color: var(--fg-2); }
.source small a { color: inherit; }
.dl { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.dl .btn { padding: 10px 16px; font-size: 14.5px; }
.dl .btn.mine { border-color: var(--action); color: var(--action); }
.install {
  position: relative; margin: 14px 0 0; padding: 12px 96px 12px 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; line-height: 1.5;
}
.install code { font-size: inherit; }
.install .copy {
  position: absolute; right: 8px; top: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--fg-2); font: inherit; font-family: var(--font); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.install .copy:hover { color: var(--fg); border-color: var(--fg-2); }
.install .copy.done { color: var(--action); border-color: var(--action); }
@media (max-width: 560px) { .ways li { grid-template-columns: 1fr; gap: 10px; } }

/* FAQ */
.faq { padding: clamp(80px, 11vw, 140px) 0 0; }
.qa { max-width: 820px; margin: 36px auto 0; border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  list-style: none; cursor: pointer; padding: 18px 40px 18px 4px; position: relative;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 22px; font-weight: 400; color: var(--fg-2); line-height: 1;
}
.qa details[open] summary::after { content: "–"; }
.qa p { margin: 0; padding: 0 40px 20px 4px; font-size: 15.5px; line-height: 1.6; color: var(--fg-2); }
.qa p a { color: var(--action); }

/* The notice: one card, the things a newcomer must know. */
.notice { padding: clamp(72px, 10vw, 120px) 0 0; }
.notice .card {
  max-width: 820px; margin: 0 auto; padding: 26px 28px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.notice .tag { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--action); }
.notice .notice-title { text-align: left; margin: 0 0 12px; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; letter-spacing: -0.02em; }
.notice p + p { margin-top: 12px; }
.notice .cta { justify-content: flex-start; margin-top: 18px; }
.eyebrow a { color: var(--action); }
.eyebrow a:hover { text-decoration: underline; }
html[data-lang="zh"] .notice .tag { text-transform: none; letter-spacing: 0.02em; }
.notice p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--fg); }
.notice .links { margin-top: 14px; font-size: 14.5px; }
.notice .links a { color: var(--action); margin-right: 18px; }

/* News: a dated list, newest first. */
.news { padding: clamp(80px, 11vw, 140px) 0 0; }
.news ol { list-style: none; margin: 36px auto 0; padding: 0; max-width: 820px; border-top: 1px solid var(--line); }
.news li { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 22px 4px; border-bottom: 1px solid var(--line); }
.news time { font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; color: var(--fg-2); padding-top: 3px; }
.news h3 { margin: 0; font-size: 17px; font-weight: 600; }
.news h3 a { color: var(--fg); }
.news h3 a:hover { color: var(--action); }
.news p { margin: 8px 0 0; font-size: 15px; line-height: 1.55; color: var(--fg-2); }
@media (max-width: 560px) { .news li { grid-template-columns: 1fr; gap: 6px; } }
.grid { padding: clamp(80px, 11vw, 140px) 0 0; }
.grid ul {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.grid li { background: var(--bg-2); border-radius: var(--radius); padding: 28px 26px 26px; }
.grid li p { margin: 10px 0 0; color: var(--fg-2); font-size: 15.5px; line-height: 1.55; }
@media (max-width: 900px) { .grid ul { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid ul { grid-template-columns: 1fr; } }

section .sub { max-width: 720px; margin: 14px auto 0; text-align: center; color: var(--fg-2); font-size: 16px; }
.pillars ul { grid-template-columns: repeat(4, 1fr); }
.pillars li { position: relative; }
@media (max-width: 1000px) { .pillars ul { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pillars ul { grid-template-columns: 1fr; } }

.compare { padding: clamp(80px, 11vw, 140px) 0 0; }
.compare .table { margin: 36px auto 0; max-width: 1040px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; min-width: 720px; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 14px 14px; border-bottom: 1px solid var(--line); }
.compare thead th { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--fg-2); border-bottom: 1px solid var(--fg-2); }
.compare thead th:last-child { color: var(--action); }
.compare tbody th { font-weight: 600; color: var(--fg); width: 18%; }
.compare tbody td { color: var(--fg-2); }
.compare tbody td:last-child { color: var(--fg); }

.how { padding: clamp(80px, 11vw, 140px) 0 0; }
.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 40px); margin-top: 40px; }
@media (max-width: 1000px) { .cols { grid-template-columns: repeat(2, 1fr); } }
.cols p { margin: 10px 0 0; color: var(--fg-2); font-size: 15.5px; line-height: 1.55; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; gap: 28px; } }

.versions { padding: clamp(80px, 11vw, 140px) 0 0; }
.versions ol { list-style: none; margin: 36px auto 0; padding: 0; max-width: 820px; border-top: 1px solid var(--line); }
.versions li {
  display: grid; grid-template-columns: 64px 140px 1fr; gap: 16px; align-items: baseline;
  padding: 16px 4px; border-bottom: 1px solid var(--line); font-size: 15.5px;
}
.versions li a, .versions li .ver { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--action); }
.versions li .ver { color: var(--fg-2); }
.versions .name { font-weight: 600; }
.versions .what { color: var(--fg-2); }
.versions .current .name::after {
  content: "latest"; margin-left: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  padding: 2px 8px; border-radius: 999px; background: var(--action); color: var(--action-fg); vertical-align: middle;
}
html[data-lang="zh"] .versions .current .name::after { content: "最新"; }
.versions .next { color: var(--fg-2); }
.versions li[hidden] { display: none; }
.versions .earlier { display: block; padding: 0; }
.versions .earlier button {
  display: block; width: 100%; padding: 14px 4px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--action); text-align: center;
}
.versions .earlier button:hover { text-decoration: underline; }
.versions .earlier .hide, .versions .earlier.open .show { display: none; }
.versions .earlier.open .hide { display: inline; }
.versions .more { text-align: center; margin: 28px 0 0; font-size: 15px; }
.versions .more a { color: var(--action); }
@media (max-width: 560px) {
  .versions li { grid-template-columns: 56px 1fr; }
  .versions li .what { grid-column: 1 / -1; }
}

/* Footer */
footer { margin-top: clamp(80px, 11vw, 140px); padding: 36px clamp(20px, 5vw, 56px) 56px; border-top: 1px solid var(--line); }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; font-size: 14px; color: var(--fg-2); }
footer nav a:hover { color: var(--fg); }
footer nav button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
footer nav button:hover { color: var(--fg); }
footer p { max-width: 760px; margin: 22px auto 0; text-align: center; font-size: 13px; color: var(--fg-2); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Doc pages (own-key/): one column of prose under the shared nav */
.doc { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(20px, 5vw, 56px) 40px; }
.doc .crumb { font-size: 14px; color: var(--fg-2); }
.doc .crumb a { color: var(--action); }
.doc h1 { margin-top: 10px; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
.doc .lead { margin: 16px 0 0; font-size: 18px; line-height: 1.55; color: var(--fg-2); }
.doc h2 { margin-top: clamp(40px, 5vw, 56px); font-size: 26px; text-align: left; }
.doc h3 { margin-top: 28px; }
.doc p, .doc li { font-size: 16.5px; line-height: 1.65; }
.doc p { margin: 12px 0 0; }
.doc ul, .doc ol { margin: 12px 0 0; padding-left: 24px; }
.doc li + li { margin-top: 8px; }
.doc li ul { margin-top: 6px; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; background: var(--bg-2); border-radius: 6px; padding: 1px 6px; }
.doc .steps { list-style: none; counter-reset: step; padding: 0; margin-top: 20px; }
.doc .steps li { counter-increment: step; position: relative; padding: 18px 20px 18px 64px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.doc .steps li + li { margin-top: 12px; }
.doc .steps li::before { content: counter(step); position: absolute; left: 18px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--action); color: var(--action-fg); font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.doc .steps strong { display: block; font-size: 17px; margin-bottom: 4px; }
.doc .callout { margin-top: 20px; padding: 14px 18px; border-left: 3px solid var(--action); background: var(--bg-2); border-radius: 0 12px 12px 0; font-size: 15.5px; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15.5px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--fg-2); font-weight: 600; font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.04em; }
html[data-lang="zh"] .doc th { text-transform: none; letter-spacing: 0; }
.doc .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
