/* =========================================================
   惠飞的坨坨 · Dashboard-N1 — Apple-style minimal
   ========================================================= */

/* ---------- Design Tokens (Apple palette) ---------- */
:root {
  --bg: #ffffff;
  --section: #f5f5f7;      /* Apple signature light gray */
  --card: #ffffff;
  --ink: #1d1d1f;
  --sub: #6e6e73;
  --faint: #86868b;
  --link: #06c;
  --link-h: #0077ed;
  --btn: #0071e3;
  --btn-h: #0077ed;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;

  /* brand accent, kept very restrained */
  --rose: #c99b7a;
  --leaf: #6c8a4a;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Helvetica Neue", Helvetica, Arial, sans-serif;

  --radius-card: 18px;
  --radius-pill: 980px;
  --max: 1050px;
  --max-wide: 1240px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: rgba(0,0,0,.05);
  border-radius: 5px;
  padding: 2px 6px;
}

/* ---------- Type ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: clamp(40px, 6vw, 64px); line-height: 1.05; }
h2 { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; }
h3 { font-size: 19px; line-height: 1.3; }
p  { margin: 0; color: var(--sub); }
.sub { color: var(--sub); }
.small { font-size: 14px; }
.tiny { font-size: 12px; color: var(--faint); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: var(--max-wide); margin: 0 auto; padding: 0 24px; }
.sec { padding: 110px 0; }
.sec-gray { background: var(--section); }
.sec-center { text-align: center; }
@media (max-width: 800px) { .sec { padding: 70px 0; } }

/* ---------- Nav (Apple 44px) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: 44px;
  background: rgba(251, 251, 253, .8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.08);
}
.nav-inner {
  max-width: var(--max-wide);
  height: 100%;
  margin: 0 auto;
  padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; opacity: .8; }
.brand svg { color: var(--ink); }
.brand .brand-model {
  color: var(--sub);
  font-weight: 400;
  font-size: 12px;
  border-left: 1px solid var(--line);
  padding-left: 8px;
}
.nav-links { display: flex; align-items: center; gap: 2px; height: 100%; }
.nav-links a {
  display: inline-flex; align-items: center;
  height: 100%;
  padding: 0 13px;
  font-size: 12px;
  color: rgba(29, 29, 31, .8);
}
.nav-links a:hover { text-decoration: none; color: var(--ink); }
.nav-links a.active { color: var(--ink); }
@media (max-width: 680px) {
  .nav-links a:not(.keep) { display: none; }
  .nav-inner { padding: 0 16px; }
}

/* ---------- Buttons (pill, Apple blue) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 400;
  color: #fff;
  background: var(--btn);
  border-radius: var(--radius-pill);
  transition: background .15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--btn-h); }
.btn.btn-dark { background: var(--ink); }
.btn.btn-dark:hover { background: #333336; }
.btn-sm { padding: 6px 15px; font-size: 14px; }
.link-more { color: var(--link); font-size: 16px; }
.link-more:hover { text-decoration: underline; }
.link-more .chev { display: inline-block; transition: transform .2s; font-weight: 400; }
.link-more:hover .chev { transform: translateX(2px); }

/* ---------- Hero (index) ---------- */
.hero {
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 120px, #ffffff 300px);
  text-align: center;
  padding: 84px 24px 40px;
  overflow: hidden;
}
.hero-kicker {
  font-size: 13px;
  color: var(--sub);
  letter-spacing: .02em;
  margin-bottom: 14px;
}
.hero-kicker .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--leaf); margin: 0 8px 1px; vertical-align: middle;
}
.hero h1 { margin-bottom: 10px; }
.hero-sub {
  font-size: clamp(18px, 2.6vw, 26px);
  color: var(--sub);
  max-width: 720px;
  margin: 0 auto;
  font-weight: 400;
  line-height: 1.35;
}
.hero-links {
  margin: 26px 0 8px;
  display: flex; gap: 34px; justify-content: center; flex-wrap: wrap;
  font-size: 17px;
}
.hero-img {
  margin: 48px auto 0;
  max-width: min(920px, 100%);
}
.hero-img img {
  width: 100%; height: auto;
  border-radius: 8px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.06);
}
.hero-note {
  margin-top: 26px;
  font-size: 12px; color: var(--faint);
}
@media (max-width: 800px) { .hero { padding-top: 56px; } }

/* ---------- Intro statement (index) ---------- */
.statement {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.statement em { font-style: normal; color: var(--sub); font-weight: 500; }
.statement b { color: var(--ink); font-weight: 600; }

.media-block { margin: 64px auto 0; max-width: min(1000px, 100%); }
.media-block img { border-radius: 14px; width: 100%; height: auto; }

/* ---------- Standalone gallery image band (index) ---------- */
.gallery-img {
  display: block;
  width: 100%;
  max-width: min(1000px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 30px 60px -25px rgba(0,0,0,.15);
}
@media (max-width: 800px) { .gallery-img { border-radius: 14px; } }

/* ---------- Card grid ---------- */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 36px 30px;
  text-align: left;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,.08); }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 15px; }
.card .card-kicker {
  font-size: 12px;
  color: var(--link);
  font-weight: 600;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 600;
  margin-bottom: 18px;
  color: #fff;
  background: var(--ink);
}
.card-icon.leaf { background: var(--leaf); }
.card-icon.rose { background: var(--rose); }
.card-icon.gold { background: #b08a4a; }
@media (max-width: 860px) { .cards-3, .cards-2 { grid-template-columns: 1fr; } }

/* ---------- OS Segmented Control ---------- */
.seg {
  display: inline-flex;
  background: rgba(0,0,0,.06);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
  justify-content: center;
}
.seg button {
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--ink);
  transition: all .18s ease;
}
.seg button.active {
  background: var(--bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  font-weight: 600;
}
.seg button:not(.active):hover { background: rgba(255,255,255,.45); }

/* ---------- Driver rows ---------- */
.dl { display: flex; flex-direction: column; gap: 14px; margin-top: 40px; }
.driver {
  display: flex; align-items: center; gap: 22px;
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 22px 26px;
  text-align: left;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
  border: 1px solid var(--line-soft);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.driver:hover { border-color: var(--line); box-shadow: 0 12px 32px rgba(0,0,0,.07); }
.driver-ic {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 14px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  background: var(--ink);
}
.driver-ic.fw { background: var(--leaf); }
.driver-ic.cp { background: var(--rose); }
.driver-ic.sdk { background: #5b6a86; }
.driver-ic.uart { background: #0071e3; }
.driver-main { flex: 1; min-width: 0; }
.driver-name {
  font-size: 18px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.badge {
  font-size: 11px; font-weight: 600;
  color: #fff; background: var(--btn);
  border-radius: 99px; padding: 2px 9px;
  letter-spacing: .03em;
}
.badge.gray { background: #86868b; }
.badge.orange { background: #d05a17; }
.driver-desc { font-size: 14px; margin-top: 3px; max-width: 640px; }
.driver-meta {
  margin-top: 7px;
  font-size: 12px; color: var(--faint);
  display: flex; gap: 18px; flex-wrap: wrap;
}
.driver-meta .sep { opacity: .5; }
.driver-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.driver-size { font-size: 12px; color: var(--faint); white-space: nowrap; }
@media (max-width: 760px) {
  .driver { flex-direction: column; align-items: stretch; gap: 14px; }
  .driver-side { justify-content: space-between; }
}

/* ---------- Page head (sub pages) ---------- */
.page-head {
  background: linear-gradient(180deg, #fbfbfd, #f5f5f7);
  padding: 70px 24px 44px;
  text-align: center;
}
.page-head h1 { margin-bottom: 12px; }
.page-head p { max-width: 640px; margin: 0 auto; font-size: 19px; }
.page-head .crumb { font-size: 13px; color: var(--faint); margin-bottom: 14px; }
.page-head .crumb a { color: var(--faint); }
.page-head .crumb a:hover { color: var(--link); }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line-soft); }
.faq-item:last-child { border-bottom: 0; }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  padding: 26px 4px;
  text-align: left;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.faq-q .plus { position: relative; width: 14px; height: 14px; flex-shrink: 0; }
.faq-q .plus::before, .faq-q .plus::after {
  content: ""; position: absolute; background: var(--sub);
  border-radius: 2px;
}
.faq-q .plus::before { left: 0; right: 0; top: 6px; height: 1.5px; }
.faq-q .plus::after { top: 0; bottom: 0; left: 6px; width: 1.5px; }
.faq-item.open .faq-q .plus::after { display: none; }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .35s ease;
  font-size: 15px; color: var(--sub);
  line-height: 1.7;
}
.faq-item.open .faq-a { max-height: 600px; padding: 0 40px 28px 4px; }
.faq-a a { color: var(--link); }
.faq-a p + .faq-sub { margin-top: 8px; }
.faq-sub {
  margin: 12px 0 0;
  font-size: 13.5px; color: var(--faint); line-height: 1.65;
}

/* ---------- Simple text list (install steps) ---------- */
.steps { max-width: 700px; margin: 0 auto; }
.step { display: flex; gap: 26px; padding: 28px 0; border-bottom: 1px solid var(--line-soft); }
.step:last-child { border-bottom: 0; }
.step-n {
  font-size: 14px; font-weight: 700; color: var(--link);
  flex-shrink: 0; padding-top: 3px; min-width: 26px;
}
.step h3 { margin-bottom: 6px; font-size: 21px; }
.step p { font-size: 15px; max-width: 560px; }
.step p b { color: var(--ink); font-weight: 600; }

/* ---------- Changelog ---------- */
.cl { max-width: 760px; margin: 0 auto; }
.cl-entry { padding: 34px 0; border-bottom: 1px solid var(--line-soft); }
.cl-entry:last-child { border-bottom: 0; }
.cl-ver { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.cl-ver h3 { font-size: 23px; }
.cl-date { font-size: 13px; color: var(--faint); }
.cl-title { font-size: 15px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.cl-ul { margin-top: 8px; }
.cl-ul li {
  position: relative;
  padding: 4px 0 4px 24px;
  font-size: 15px;
  color: var(--sub);
}
.cl-ul li::before {
  content: "+";
  position: absolute; left: 4px;
  font-weight: 700; color: var(--link); font-size: 13px; top: 5px;
}
.cl-ul li.fix::before { content: "×"; color: var(--sub); font-weight: 500; }

/* ---------- Footer ---------- */
.footer { background: var(--section); margin-top: 0; padding: 50px 24px 30px; }
.footer-top {
  max-width: var(--max-wide); margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-col h4 { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 12px; color: var(--sub); }
.footer-col a:hover { color: var(--ink); text-decoration: none; }
.footer-brand { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.footer-brand-sub { font-size: 12px; color: var(--faint); max-width: 300px; line-height: 1.6; }
.footer-bottom {
  max-width: var(--max-wide); margin: 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--faint);
}
@media (max-width: 800px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ---------- Misc ---------- */
.hidden { display: none !important; }
.center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-36 { margin-top: 36px; }
.mt-56 { margin-top: 56px; }
.inline-block { display: inline-block; }

/* ---------- Spec grid (centered) ---------- */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 44px;
  max-width: 880px;
  margin: 36px auto 0;
  text-align: center;
}
.spec-grid > div {
  padding: 6px 8px;
}
@media (max-width: 820px) {
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .spec-grid { grid-template-columns: 1fr; }
}
