:root {
  color-scheme: light;
  --wx-green: #07c160;
  --ink: #222;
  --link: #576b95;
  --muted: #888;
  --line: #e5e5e5;
  --nav-bg: #f7f7f7;
  --code-bg: #f9f9fa;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF UI Text", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  width: 100%;
  height: 64px;
  background: var(--nav-bg);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
}

.navbar__left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 64px;
  padding-left: 24px;
}

.brand, .product {
  color: #000;
  font-size: 16px;
  font-weight: 500;
}

.dot {
  width: 4px;
  height: 4px;
  margin: 0 12px;
  border-radius: 50%;
  background: #000;
}

.navbar__center {
  display: flex;
  align-items: center;
  height: 64px;
  margin-left: 48px;
}

.nav-item {
  position: relative;
  display: inline-block;
  height: 64px;
  padding: 0 16px;
  color: #000;
  font-size: 16px;
  line-height: 64px;
}

.nav-item.selected { font-weight: 500; }

.nav-item.selected::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #000;
}

.layout { padding-top: 64px; }

.sidebar {
  position: fixed;
  top: 64px;
  bottom: 0;
  left: 0;
  width: 300px;
  overflow: auto;
  padding: 28px 24px 40px 8px;
  background: #fff;
}

.side-group + .side-group { margin-top: 18px; }

.side-fold > summary { cursor: pointer; list-style: none; }
.side-fold > summary::-webkit-details-marker { display: none; }
.side-fold > summary::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -4px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid #888;
}
.side-fold[open] > summary::before { transform: rotate(90deg); margin-top: -5px; margin-left: -1px; }
.side-title, .side-cat { position: relative; }

.side-cat {
  margin: 8px 0 2px;
  padding-left: 30px;
  color: #222;
  font-size: 14px;
  font-weight: 600;
}

.side-title {
  display: block;
  padding: 8px 0 8px 30px;
  color: #222;
  font-size: 16px;
  font-weight: 600;
}

.sidebar ul { margin: 0 0 8px; padding: 0; list-style: none; }

.sidebar li a {
  position: relative;
  display: block;
  padding: 6px 0 6px 44px;
  color: #888;
  font-size: 14px;
  transition: color 0.3s;
}

.sidebar li a:hover { color: #222; }

.sidebar li a[aria-current="page"] {
  color: var(--wx-green);
  font-weight: 600;
}

.sidebar li a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 30px;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--wx-green);
}

.page {
  margin-left: 300px;
  padding: 40px 64px 100px;
}

.content {
  max-width: 920px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.content h1 {
  margin: 0 0 0.8em;
  color: #222;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.content h2 {
  margin: 2em 0 0.5em;
  color: #222;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.content h3 {
  margin: 1.2em 0 0.5em;
  color: #222;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.content section:first-of-type h2,
.seq header h2 { margin-top: 0; }

.content p { margin: 0 0 0.5em; color: #353535; }

.content .body > * + * { margin-top: 0.8em; }

.content a { color: var(--link); }
.content a:hover { text-decoration: underline; }

.content ul { margin: 0 0 0.5em; padding-left: 1.25rem; }
.content li { margin: 0; padding-left: 0.25rem; color: #353535; }

.content code {
  display: inline-block;
  padding: 2px 0.4em;
  border-radius: 2px;
  background: var(--code-bg);
  color: #222;
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.85em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.content pre {
  margin: 1em 0;
  padding: 30px;
  overflow: auto;
  border-radius: 4px;
  background: var(--code-bg);
  color: #353535;
  font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre;
}

.content pre code {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
}

.code-block .pre-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #b2b2b2;
  font-size: 12px;
}
.token.comment { color: #8c8c8c; }
.token.string { color: #22863a; }
.token.keyword { color: #0550ae; }
.token.function { color: #8250df; }
.token.variable { color: #953800; }

.table-wrap { overflow-x: auto; }

.content table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: transparent;
  font-size: 14px;
}

.content th, .content td {
  text-align: left;
  vertical-align: top;
  word-break: normal;
}

.content th {
  padding: 10px 20px;
  border-bottom: 1px solid #888;
  color: #888;
  font-weight: 600;
  white-space: nowrap;
}

.content td {
  height: 62px;
  padding: 20px;
  border-bottom: 1px solid #e5e5e5;
  color: #353535;
  box-sizing: border-box;
}

.content th:first-child, .content td:first-child { padding-left: 0; }
.content th:last-child, .content td:last-child { padding-right: 0; }

.content blockquote {
  margin: 1em 0;
  padding-left: 10px;
  border: 0;
  border-left: 4px solid #ebebeb;
  background: transparent;
  color: #b2b2b2;
}

.seq {
  margin: 0 0 2em;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  background: #fff;
}

.seq header { padding: 16px 20px 12px; border-bottom: 1px solid #e5e5e5; }
.seq header h2 { margin: 0; font-size: 16px; }
.seq header p { margin: 4px 0 0; color: #888; font-size: 12px; line-height: 1.6; }
.seq-scroll { overflow-x: auto; padding: 16px 12px 20px; }
.seq-board { min-width: 880px; }
.actors, .lifelines { display: grid; gap: 8px; }

.actor {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92%;
  min-height: 48px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid #d7efe4;
  border-radius: 4px;
  background: #f3fbf7;
  color: #222;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.actor.platform { border-color: #e5e5e5; background: #f7f7f7; }

.seq-body { position: relative; margin-top: 12px; }
.lifelines { position: absolute; inset: 0; pointer-events: none; }
.life { display: flex; justify-content: center; }
.life::before { content: ""; border-left: 1px dashed #e5e5e5; }

.seq .band {
  position: relative;
  z-index: 1;
  margin: 12px 4px 4px;
  padding: 6px 12px;
  border-radius: 2px;
  background: #f7f7f7;
  color: #888;
  font-size: 12px;
  font-weight: 500;
}

.seq .step.current .band { background: rgba(7, 193, 96, 0.1); color: var(--wx-green); }

.seq .row {
  position: relative;
  z-index: 1;
  display: block;
  height: 64px;
  color: #353535;
}

.seq .row:hover { background: rgba(7, 193, 96, 0.06); text-decoration: none; }

.seq .label {
  position: absolute;
  top: 6px;
  max-width: 180px;
  transform: translateX(-50%);
  padding: 0 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
  color: #353535;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.seq .arrow, .seq .loop { position: absolute; top: 50%; }
.seq .arrow { display: flex; align-items: center; height: 0; transform: translateY(-50%); }
.seq .shaft { flex: 1; height: 1px; background: #888; }
.seq .arrow.dashed .shaft { height: 0; background: none; border-top: 1px dashed #888; }
.seq .arrow.left::before,
.seq .arrow.right::after { content: ""; flex-shrink: 0; }
.seq .arrow.left::before { border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-right: 7px solid #888; }
.seq .arrow.right::after { border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid #888; }

.seq .loop {
  top: 62%;
  width: 36px;
  height: 28px;
  transform: translateY(-50%);
  border: 1px solid #888;
  border-left: 0;
  border-radius: 0 4px 4px 0;
}

.seq .loop::before {
  content: "";
  position: absolute;
  left: -5px;
  bottom: -5px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-right: 6px solid #888;
}

@media (max-width: 960px) {
  .navbar__center { display: none; }
  .sidebar { position: static; width: auto; padding: 16px; }
  .page { margin-left: 0; padding: 8px 16px 48px; }
  .layout { display: flex; flex-direction: column; }
}
