:root {
  color-scheme: light;
  --ink: #1c2430;
  --muted: #68758a;
  --line: #dce3ec;
  --paper: #fbf8f1;
  --surface: #ffffff;
  --soft: #f4f7f9;
  --blue: #246bfe;
  --teal: #078c7f;
  --gold: #b57a1a;
  --code-bg: #17202c;
  --shadow: 0 22px 58px rgba(28, 36, 48, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(36, 107, 254, 0.08), transparent 34%),
    linear-gradient(180deg, var(--paper), #f4f7f9 34%, #ffffff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.75;
}

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

.doc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(220, 227, 236, 0.76);
  background: rgba(251, 248, 241, 0.92);
  backdrop-filter: blur(18px);
}

.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 18px;
  font-weight: 780;
}

.doc-brand img {
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(28, 36, 48, 0.16);
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.doc-nav a,
.doc-footer a {
  color: #435066;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.doc-nav a {
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 680;
}

.doc-nav a:hover,
.doc-footer a:hover,
.doc-toc a:hover { color: var(--blue); }

.doc-shell {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 920px);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(18px, 4vw, 56px);
}

.doc-toc {
  position: sticky;
  top: 98px;
  max-height: calc(100svh - 122px);
  overflow: auto;
  padding: 18px;
  border: 1px solid rgba(220, 227, 236, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 34px rgba(28, 36, 48, 0.06);
}

.doc-toc strong {
  display: block;
  margin-bottom: 12px;
  color: #202b3b;
  font-size: 14px;
}

.doc-toc a {
  display: block;
  padding: 8px 0;
  color: var(--muted);
  border-top: 1px solid rgba(220, 227, 236, 0.65);
  font-size: 14px;
  line-height: 1.4;
}

.doc-article {
  min-width: 0;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(220, 227, 236, 0.94);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.doc-kicker {
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 14px;
  font-weight: 780;
}

.doc-article h1,
.doc-article h2,
.doc-article h3,
.doc-article h4,
.doc-article p,
.doc-article li,
.doc-article td,
.doc-article th {
  overflow-wrap: anywhere;
}

.doc-article h1 {
  margin: 0 0 22px;
  color: #131b26;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

.doc-article h2 {
  margin: 44px 0 16px;
  padding-top: 8px;
  color: #1d2838;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.22;
  letter-spacing: 0;
}

.doc-article h2::before {
  content: "";
  display: block;
  width: 42px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.doc-article h3 {
  margin: 34px 0 12px;
  color: #203044;
  font-size: 21px;
  line-height: 1.3;
}

.doc-article h4 {
  margin: 28px 0 10px;
  color: #2b3a4e;
  font-size: 18px;
}

.doc-article p {
  margin: 14px 0;
  color: #435066;
  font-size: 17px;
}

.doc-article ol,
.doc-article ul {
  margin: 14px 0 22px;
  padding-left: 0;
  list-style: none;
  counter-reset: item;
}

.doc-article li {
  position: relative;
  margin: 10px 0;
  padding: 13px 16px 13px 48px;
  border: 1px solid rgba(220, 227, 236, 0.86);
  border-radius: 8px;
  color: #415064;
  background: #fbfcfd;
  font-size: 16px;
}

.doc-article ol li { counter-increment: item; }
.doc-article ol li::before {
  content: counter(item);
  position: absolute;
  left: 15px;
  top: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.doc-article ul li::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 22px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
}

.doc-article code {
  padding: 2px 6px;
  border-radius: 6px;
  color: #0f625a;
  background: #e8f5f2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

.doc-article pre {
  overflow: auto;
  margin: 18px 0 26px;
  padding: 18px;
  border-radius: 8px;
  background: var(--code-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.doc-article pre code {
  padding: 0;
  color: #e8eef7;
  background: transparent;
  font-size: 14px;
  line-height: 1.6;
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 15px;
}

th {
  color: #1e2c3f;
  background: #f2f6fb;
  font-weight: 760;
}

tr:last-child td { border-bottom: 0; }

.doc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px) 42px;
  color: var(--muted);
}

.doc-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .doc-shell { grid-template-columns: 1fr; }
  .doc-toc { position: static; max-height: none; }
}

@media (max-width: 640px) {
  .doc-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .doc-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .doc-nav a { flex: 1 1 auto; text-align: center; }
  .doc-article { padding: 24px 18px; }
  .doc-article li { padding-right: 13px; }
  .doc-footer { flex-direction: column; align-items: flex-start; }
}
