:root {
  color-scheme: light;
  --paper: #fbfcfd;
  --panel: rgba(255, 255, 255, 0.86);
  --ink: #17202a;
  --muted: #5b6573;
  --line: #d8e0e7;
  --mint: #42d3b5;
  --blue: #6aa6ff;
  --yellow: #f6d75b;
  --green-soft: #e7fbf4;
  --blue-soft: #eef6ff;
  --shadow: 0 18px 50px rgba(31, 45, 61, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(242, 248, 251, 0.9), rgba(251, 252, 253, 1) 420px),
    var(--paper);
  font-size: 16px;
  line-height: 1.7;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: #1b65d8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.repo-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(216, 224, 231, 0.86);
  background: rgba(251, 252, 253, 0.88);
  backdrop-filter: blur(16px);
}

.repo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
}

.repo-brand span:last-child {
  min-width: 0;
}

.repo-brand strong,
.repo-brand small {
  display: block;
  white-space: nowrap;
}

.repo-brand small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.brand-glyph {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid #b8c6d3;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 44%, #17202a 45%, #17202a 53%, transparent 54%),
    radial-gradient(circle at 28% 32%, var(--mint) 0 8px, transparent 9px),
    radial-gradient(circle at 70% 70%, var(--blue) 0 7px, transparent 8px),
    #fff;
  box-shadow: inset 0 0 0 4px rgba(66, 211, 181, 0.08);
}

.brand-glyph.small {
  width: 28px;
  height: 28px;
}

.repo-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.repo-nav a {
  color: var(--muted);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
}

.repo-nav a:hover,
.repo-nav a[aria-current="page"] {
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--line);
}

.menu-toggle {
  display: none;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 11px;
  font: inherit;
}

main {
  overflow: hidden;
}

.repo-cover,
.inner-readme,
.readme-grid,
.issue-board,
.package-slab,
.device-strip,
.logbook,
.platform-diff,
.install-lane,
.source-note,
.plan-matrix,
.scenario-issues,
.route-table,
.network-background,
.device-chapters,
.issue-groups,
.faq-threads,
.article-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.repo-cover {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  gap: 28px;
  align-items: stretch;
  padding: 46px 0 34px;
}

.repo-copy,
.inner-readme {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.repo-copy {
  padding: clamp(26px, 4vw, 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.inner-readme {
  margin-top: 34px;
  padding: clamp(26px, 4vw, 44px);
}

.repo-path {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.repo-path strong {
  color: var(--ink);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.04;
  font-weight: 760;
}

.inner-readme h1 {
  font-size: clamp(32px, 5vw, 58px);
}

.lead {
  margin: 18px 0 0;
  color: #344153;
  font-size: clamp(17px, 2vw, 20px);
  max-width: 760px;
}

.repo-actions,
.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.cmd,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid #c8d4df;
  background: #fff;
  color: var(--ink);
  padding: 9px 14px;
  font-weight: 650;
  text-decoration: none;
}

.cmd.primary {
  background: #17202a;
  color: #fff;
  border-color: #17202a;
}

.cmd:hover,
.text-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(31, 45, 61, 0.1);
  text-decoration: none;
}

.commit-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.commit-rail span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.commit-rail .branch {
  color: #116c53;
  background: var(--green-soft);
}

.workbench-figure {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.workbench-figure img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.workbench-figure figcaption {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.workbench-figure span {
  background: #fff;
  padding: 10px;
  text-align: center;
}

.section-head {
  grid-column: 1 / -1;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
}

.overline {
  margin: 0 0 6px;
  color: #116c53;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.readme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 30px 0;
}

.readme-step,
.issue-card,
.platform-tile,
.platform-detail,
.install-lane article,
.source-note,
.plan-row,
.issue-thread,
.network-row,
.background-grid article,
.device-chapter,
.issue-groups article,
.reply-panel,
.log-item,
.related-box,
.prose-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.readme-step,
.issue-card,
.platform-tile,
.platform-detail,
.install-lane article,
.issue-thread,
.network-row,
.background-grid article,
.device-chapter,
.issue-groups article,
.log-item,
.related-box,
.prose-card {
  padding: 18px;
}

.step-index {
  display: inline-flex;
  margin-bottom: 12px;
  color: #116c53;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.readme-step h3,
.issue-card h3,
.platform-tile h3,
.platform-detail h3,
.install-lane h3,
.issue-thread h3,
.network-row h3,
.background-grid h3,
.device-chapter h3,
.issue-groups h3,
.log-item h3,
.related-box h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.28;
}

.readme-step p,
.issue-card p,
.platform-tile p,
.platform-detail p,
.install-lane p,
.issue-thread p,
.network-row p,
.background-grid p,
.device-chapter p,
.issue-groups p,
.log-item p,
.source-note p,
.prose-card p {
  margin: 0;
  color: var(--muted);
}

.issue-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 0 34px;
}

.issue-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
}

.issue-title,
.issue-thread div,
.device-chapter header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot,
.label-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(66, 211, 181, 0.14);
}

.issue-card.package .status-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(246, 215, 91, 0.2);
}

.issue-card.route .status-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(106, 166, 255, 0.18);
}

.issue-card.help .status-dot {
  background: #b8a7ff;
  box-shadow: 0 0 0 4px rgba(184, 167, 255, 0.16);
}

.issue-card a {
  margin-top: auto;
  font-weight: 700;
}

.package-slab,
.device-strip,
.logbook,
.platform-diff,
.install-lane,
.plan-matrix,
.scenario-issues,
.route-table,
.network-background,
.device-chapters,
.issue-groups,
.faq-threads {
  padding: 34px 0;
}

.package-table {
  display: grid;
  gap: 10px;
}

.plan-row {
  display: grid;
  grid-template-columns: 0.75fr 1.1fr 1.1fr 1.25fr;
  gap: 1px;
  padding: 0;
  overflow: hidden;
  background: var(--line);
}

.plan-row > div {
  background: #fff;
  padding: 14px;
}

.plan-row strong {
  color: #116c53;
}

.platform-row,
.background-grid,
.issue-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.platform-tile span {
  display: inline-flex;
  margin-bottom: 8px;
  color: #116c53;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.log-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.log-list.expanded {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.log-item div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.log-item em {
  color: #116c53;
  font-style: normal;
}

.platform-diff {
  display: grid;
  gap: 14px;
}

.platform-detail {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(0, 1fr) minmax(230px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.platform-detail ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.platform-detail li,
.chip-line span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #fff;
  color: #344153;
}

.install-lane {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.source-note {
  padding: 22px;
  margin-top: 24px;
  margin-bottom: 34px;
  background: linear-gradient(135deg, rgba(231, 251, 244, 0.9), rgba(238, 246, 255, 0.9));
}

.source-note h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.scenario-issues,
.network-rows,
.device-chapters,
.faq-threads {
  display: grid;
  gap: 14px;
}

.network-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr) minmax(240px, 0.9fr);
  gap: 16px;
  align-items: center;
}

.network-row span {
  color: #344153;
  background: var(--blue-soft);
  border: 1px solid #cfe0f7;
  border-radius: 6px;
  padding: 10px;
}

.background-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-head.wide {
  grid-column: 1 / -1;
}

.device-chapter header {
  margin-bottom: 10px;
}

.device-chapter small {
  color: var(--muted);
}

.chip-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.reply-panel {
  padding: 0;
  overflow: hidden;
}

.reply-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  cursor: pointer;
  font-weight: 720;
  line-height: 1.35;
}

.reply-panel p {
  margin: 0;
  padding: 0 18px 18px 38px;
  color: var(--muted);
}

.article-shell {
  padding: 34px 0;
}

.article-head {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: clamp(24px, 4vw, 42px);
  box-shadow: var(--shadow);
}

.article-head time {
  display: inline-flex;
  margin-top: 18px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.article-body {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.article-body section {
  border-left: 3px solid var(--mint);
  padding: 4px 0 4px 18px;
}

.article-body h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.article-body p {
  margin: 0;
  color: #344153;
}

.related-box {
  margin-top: 22px;
}

.prose-card {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.missing-page {
  min-height: 52vh;
}

.repo-footer {
  margin-top: 50px;
  border-top: 1px solid var(--line);
  background: #f4f7fa;
}

.footer-root {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 2.1fr);
  gap: 28px;
  padding: 28px 0;
}

.footer-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
}

.footer-intro p {
  margin: 0;
}

.repo-footer nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.repo-footer h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.repo-footer a {
  display: block;
  color: var(--muted);
  margin: 5px 0;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .repo-cover {
    grid-template-columns: 1fr;
  }

  .workbench-figure img {
    min-height: 320px;
  }

  .readme-grid,
  .issue-board,
  .platform-row,
  .log-list,
  .log-list.expanded,
  .install-lane,
  .background-grid,
  .issue-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-row,
  .platform-detail,
  .network-row,
  .footer-root {
    grid-template-columns: 1fr;
  }

  .repo-footer nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .repo-top {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .repo-brand {
    max-width: calc(100% - 82px);
  }

  .repo-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .js-ready .repo-nav {
    display: none;
    width: 100%;
  }

  .js-ready .repo-top[data-open="true"] .repo-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .repo-nav {
    width: 100%;
  }

  .repo-nav a {
    border: 1px solid var(--line);
    background: #fff;
  }

  .repo-cover,
  .inner-readme,
  .readme-grid,
  .issue-board,
  .package-slab,
  .device-strip,
  .logbook,
  .platform-diff,
  .install-lane,
  .source-note,
  .plan-matrix,
  .scenario-issues,
  .route-table,
  .network-background,
  .device-chapters,
  .issue-groups,
  .faq-threads,
  .article-shell {
    width: min(100% - 28px, 1180px);
  }

  .repo-cover {
    padding-top: 20px;
  }

  .readme-grid,
  .issue-board,
  .platform-row,
  .log-list,
  .log-list.expanded,
  .install-lane,
  .background-grid,
  .issue-groups,
  .repo-footer nav {
    grid-template-columns: 1fr;
  }

  .repo-copy,
  .inner-readme,
  .article-head {
    padding: 22px;
  }

  h1 {
    font-size: clamp(31px, 12vw, 48px);
  }

  .lead {
    font-size: 16px;
  }

  .workbench-figure img {
    min-height: 240px;
  }

  .workbench-figure figcaption {
    grid-template-columns: 1fr;
  }

  .platform-detail ul {
    grid-template-columns: 1fr;
  }

  .plan-row > div {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
