:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #657084;
  --line: #d9e0ea;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --green: #0f766e;
  --blue: #1d4ed8;
  --amber: #b45309;
  --plum: #7c3aed;
  --shadow: 0 18px 50px rgba(24, 33, 47, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-mark { display: inline-grid; width: 44px; height: 34px; place-items: center; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; letter-spacing: 0; }
.top-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; color: var(--muted); font-size: 14px; }
.top-nav a { text-decoration: none; }
.top-nav a:hover, .top-nav .is-active { color: var(--green); }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  grid-template-areas: "intro map" "metrics map";
  gap: 22px 32px;
  align-items: stretch;
  padding: 54px 0 32px;
}
.intro { grid-area: intro; align-self: end; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 13px; font-weight: 800; letter-spacing: 0; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1.12; letter-spacing: 0; }
.lead { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 19px; }
.system-map { grid-area: map; margin: 0; display: grid; align-items: center; min-height: 320px; }
.system-map img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.metrics { grid-area: metrics; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.metrics div { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metrics strong { display: block; font-size: 32px; line-height: 1; }
.metrics span { color: var(--muted); }
.toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.search-box { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.search-box input { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; font: inherit; color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { min-height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: #fff; color: var(--muted); font: inherit; cursor: pointer; }
.tab.is-active { border-color: var(--green); color: var(--green); background: #edfdf8; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 20px 0 48px; }
.doc-card { min-height: 210px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.card-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.doc-card h2 { margin: 18px 0 10px; font-size: 20px; line-height: 1.3; letter-spacing: 0; }
.doc-card h2 a { text-decoration: none; }
.doc-card h2 a:hover { color: var(--blue); }
.doc-card p { margin: 0; color: var(--muted); }
.empty-state { margin: 18px 0 48px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); }
.doc-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 34px 0 56px; }
.doc-sidebar { position: sticky; top: 82px; align-self: start; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; }
.doc-sidebar a { display: block; padding: 8px 0; color: var(--muted); text-decoration: none; }
.doc-sidebar a:hover { color: var(--green); }
.doc-content { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: clamp(22px, 4vw, 48px); box-shadow: var(--shadow); }
.doc-content h1 { font-size: clamp(30px, 4vw, 46px); }
.doc-content h2 { margin-top: 38px; font-size: 28px; line-height: 1.25; letter-spacing: 0; }
.doc-content h3 { margin-top: 28px; font-size: 20px; letter-spacing: 0; }
.doc-content p, .doc-content li { color: #2b3545; }
.doc-content code { padding: 2px 5px; border-radius: 6px; background: #eef2f7; }
.doc-content pre { overflow: auto; padding: 16px; border-radius: 8px; background: #111827; color: #e5e7eb; }
.table-wrap { overflow-x: auto; margin: 18px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
blockquote { margin: 18px 0; padding: 12px 16px; border-left: 4px solid var(--green); background: #f0fdfa; color: #134e4a; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.doc-meta span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; color: var(--muted); font-size: 12px; }
.site-footer { border-top: 1px solid var(--line); padding: 24px clamp(18px, 4vw, 56px); color: var(--muted); background: #fff; }
@media (max-width: 860px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .dashboard { grid-template-columns: 1fr; grid-template-areas: "intro" "map" "metrics"; padding-top: 34px; }
  .toolbar { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; }
  .metrics { grid-template-columns: 1fr; }
}
