:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f3ef;
  --ink: #151716;
  --muted: #68706b;
  --line: #dce2dc;
  --line-strong: #b9c3ba;
  --accent: #1f7a5c;
  --accent-ink: #10513c;
  --accent-soft: #e2f1eb;
  --blue: #2f5f94;
  --amber: #8a610d;
  --error: #a53a31;
  --shadow: 0 18px 50px rgba(34, 45, 38, .09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
.button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

button.primary,
.button.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

button:hover,
.button:hover {
  border-color: var(--line-strong);
}

button:disabled {
  cursor: wait;
  opacity: .62;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(220, 226, 220, .86);
  background: rgba(246, 247, 244, .92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
}

.top-links {
  display: flex;
  gap: 4px;
  justify-content: center;
  min-width: 0;
}

.top-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 650;
}

.top-links a:hover,
.top-links a.active {
  background: var(--surface-soft);
  color: var(--ink);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.desk {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.summary-panel {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(280px, .75fr) minmax(420px, 1.45fr);
  gap: 12px;
  align-items: stretch;
}

.summary-title,
.hero-copy,
.status,
.metric,
.quick-card,
.platforms,
.platform-section,
.insight-block,
.doc-page,
.docs-nav,
.doc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(20, 24, 20, .02);
}

.summary-title {
  padding: 18px;
}

.hero-copy {
  padding: 18px;
  color: var(--muted);
  line-height: 1.6;
  display: grid;
  align-content: center;
  font-size: 15px;
}

.summary-title p,
.quick-card span,
.insight-block > span,
.docs-nav strong {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.08;
  font-weight: 780;
}

.status {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
}

.status strong {
  color: var(--accent-ink);
  font-size: 18px;
}

.status span {
  color: var(--muted);
  line-height: 1.45;
}

.status.loading strong {
  color: var(--amber);
}

.status.error strong {
  color: var(--error);
}

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

.metric {
  padding: 16px;
}

.metric b {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric:nth-child(4) b {
  font-size: 20px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.quick-start {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.section-title {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 760;
}

.quick-card {
  min-height: 86px;
  padding: 16px;
  text-decoration: none;
}

.quick-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.quick-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.platforms,
.insights {
  position: sticky;
  top: 82px;
}

.platforms {
  padding: 8px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.platform-link {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  min-height: 36px;
  padding: 9px 8px;
}

.platform-link:hover {
  background: var(--surface-soft);
}

.platform-link span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-link span:last-child {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.platform-section {
  margin-bottom: 12px;
  overflow: hidden;
}

.platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfa;
}

.platform-head h2 {
  font-size: 18px;
}

.platform-head span {
  color: var(--muted);
  font-size: 13px;
}

.item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 120px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #edf0ed;
}

.item:last-child {
  border-bottom: 0;
}

.rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.title {
  color: var(--ink);
  text-decoration: none;
  line-height: 1.45;
}

.title:hover {
  color: var(--accent-ink);
  text-decoration: underline;
}

.source {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.insights {
  display: grid;
  gap: 12px;
}

.insight-block {
  padding: 14px;
}

.preview-list {
  display: grid;
  gap: 4px;
}

.preview-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0ed;
}

.preview-item:last-child {
  border-bottom: 0;
}

.preview-item span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.preview-item a {
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  background: #f7f8f6;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  margin-top: 8px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: var(--surface);
}

.docs-layout {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 82px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.docs-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 7px;
  font-weight: 650;
}

.docs-nav a:hover,
.docs-nav a.active {
  background: var(--surface-soft);
  color: var(--ink);
}

.doc-page {
  padding: 28px;
  line-height: 1.72;
}

.doc-page h1 {
  font-size: 34px;
  margin-bottom: 18px;
}

.doc-page h2 {
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 24px;
}

.doc-page h3 {
  margin-top: 22px;
}

.doc-page p,
.doc-page li {
  color: #3f4641;
}

.doc-page pre {
  overflow: auto;
  background: #111715;
  color: #edf5ef;
  border-radius: 8px;
  padding: 14px;
}

.doc-page pre code {
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.doc-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.doc-page th,
.doc-page td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
}

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.doc-card {
  padding: 16px;
  text-decoration: none;
}

.download-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  padding: 0 14px;
  font-weight: 720;
}

.download-button:hover {
  background: #2a2d2b;
}

.doc-card span,
.doc-card b {
  display: block;
}

.doc-card span {
  color: var(--muted);
  margin-bottom: 6px;
}

@media (max-width: 1080px) {
  .summary-panel,
  .workspace {
    grid-template-columns: 1fr;
  }

  .platforms,
  .insights {
    position: static;
  }

  .platforms {
    max-height: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 14px;
  }

  .top-links,
  .top-actions {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .desk,
  .docs-layout {
    width: min(100% - 20px, 1120px);
  }

  .metrics,
  .quick-start,
  .docs-layout,
  .doc-card-grid {
    grid-template-columns: 1fr;
  }

  .item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .source {
    grid-column: 2;
    text-align: left;
  }

  .docs-nav {
    position: static;
  }
}
