:root {
  --accent: #1e61ad;
  --accent2: #17b5d1;
  --ink: #151b24;
  --muted: #667085;
  --line: #e4eaf2;
  --paper: #f5f7fb;
  --side: 304px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(135deg,rgba(30,97,173,.045) 0 12%,transparent 12% 100%),linear-gradient(180deg,#f6f8fb 0%,#eef2f7 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei","PingFang SC",Arial,sans-serif;
  line-height: 1.75;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  padding: 30px 22px;
  background: radial-gradient(circle at 20% 8%,rgba(23,181,209,.24),transparent 30%),linear-gradient(165deg,#102033 0%,#08121f 58%,#0b1524 100%);
  color: #eaf8ff;
  z-index: 20;
  overflow: auto;
  border-right: 1px solid #24557c;
  box-shadow: 8px 0 30px rgba(0,24,48,.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 24px;
  border-bottom: 1px solid #24455f;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  color: #f4fbff;
}

.brand>span {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 40px;
  border: 2px solid #35c8ee;
  background: linear-gradient(145deg,#123a62,#071524);
  color: #bfefff;
  font-weight: 800;
  letter-spacing: .6px;
  box-shadow: inset 0 0 0 2px #06101b,0 0 14px rgba(53,200,238,.22);
}

.brand small {
  display: block;
  color: #8eb1c7;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 1px;
  margin-top: 4px;
  white-space: nowrap;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.sidebar nav:before {
  content: "MANUAL NAV";
  display: block;
  margin: 0 0 12px 2px;
  color: #35c8ee;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.4px;
}

.sidebar a {
  position: relative;
  color: #a9c0d1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 5px;
  font-size: 13px;
  border: 1px solid transparent;
}

.sidebar a.main-link {
  margin-top: 6px;
  font-weight: 700;
  color: #dcecf7;
}

.sidebar a.sub-link {
  margin-left: 14px;
  padding: 7px 10px 7px 18px;
  font-size: 12px;
  color: #8fb1c8;
  border-left: 1px solid rgba(143,177,200,.24);
  border-radius: 0 5px 5px 0;
}

.sidebar a.sub-link:after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(143,177,200,.45);
}

.sidebar a:hover {
  background: #112b42;
  border-color: #2b6d9b;
  color: #f0fbff;
}

.sidebar a.active {
  background: linear-gradient(90deg,#145f93,#102b44);
  border-color: #35c8ee;
  color: #fff;
  box-shadow: inset 0 0 13px rgba(0,0,0,.24);
}

.sidebar a.active:before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: #35c8ee;
  box-shadow: 0 0 8px rgba(53,200,238,.7);
}

main {
  margin-left: var(--side);
  padding: 0 6vw 70px;
}

.hero {
  max-width: 1020px;
  margin: auto;
  padding: 78px 0 48px;
  border-bottom: 1px solid #d8e0ea;
  position: relative;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
}

.hero h1 {
  font-family: Georgia,"Microsoft YaHei",serif;
  font-size: 48px;
  line-height: 1.15;
  margin: 12px 0;
}

.hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.hero:after {
  content: "";
  display: block;
  width: 158px;
  height: 9px;
  margin-top: 26px;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg,var(--accent) 0 18px,#0f2740 18px 26px,var(--accent2) 26px 44px,#0f2740 44px 52px);
  opacity: .76;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.meta span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf3fb;
  color: #24547a;
  font-size: 12px;
  border: 1px solid #d3e4f2;
}

.chapter {
  max-width: 1020px;
  margin: 34px auto;
  padding: 42px 46px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(19,35,55,.04);
  scroll-margin-top: 25px;
}

.chapter-title {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}

.chapter-title>b {
  flex: none;
  color: var(--accent);
  font: italic 32px Georgia;
  border-right: 1px solid #d9e2ec;
  padding-right: 17px;
}

.chapter-title h2 {
  font-size: 25px;
  line-height: 1.35;
  margin: 0;
}

.chapter-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.chapter h3 {
  margin: 34px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  font-size: 18px;
  scroll-margin-top: 24px;
}

.chapter h4 {
  margin: 24px 0 12px;
  color: #1b4d7d;
  font-size: 16px;
}

.steps {
  list-style: none;
  counter-reset: step;
  margin: 18px 0;
  padding-left: 0;
}

.steps>li {
  position: relative;
  counter-increment: step;
  padding: 18px 0 26px 62px;
  border-bottom: 1px solid #edf1f6;
}

.steps>li:last-child {
  border-bottom: 0;
}

.steps>li:before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 20px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg,#2b7dcc,#14578d);
  color: #fff;
  font: bold 16px Georgia;
}

.steps>li>p {
  margin: 5px 0 13px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.65;
}

.notice {
  padding: 15px 18px;
  margin: 18px 0;
  background: #eef7ff;
  border-left: 4px solid var(--accent2);
  color: #29465d;
  border-radius: 0 5px 5px 0;
}

.inline-link {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #dff5ff;
  color: #0f6fa3;
  text-decoration: none;
  border: 1px solid #b7e7fb;
  font-weight: 700;
}

.inline-link:hover {
  background: #c9efff;
}

.link-gap {
  display: inline-block;
  margin-left: 28px;
}

.gallery {
  display: block;
  width: 100%;
  margin: 14px 0 0;
}

.gallery figure {
  width: 100%;
  margin: 0 0 18px;
  border: 1px solid #dce4ee;
  border-radius: 5px;
  background: #f7f9fc;
  overflow: hidden;
}

.gallery img {
  display: block;
  width: 100%;
  height: 460px;
  object-fit: contain;
  background: #f1f4f8;
  cursor: zoom-in;
}

.gallery figcaption {
  padding: 9px 13px;
  color: #747f8e;
  font-size: 12px;
  background: #fff;
  border-top: 1px solid #e5ebf2;
}

code {
  background: #eef4fa;
  color: #14578d;
  padding: 2px 6px;
}

.menu-button {
  display: none;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.88);
  padding: 4vh;
  place-items: center;
}

.lightbox.open {
  display: grid;
}

.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  right: 24px;
  top: 18px;
  border: 0;
  background: none;
  color: #fff;
  font-size: 42px;
  cursor: pointer;
}

@media(max-width:900px) {
  :root {
    --side: 264px;
  }

  main {
    padding-left: 4vw;
    padding-right: 4vw;
  }

  .chapter {
    padding: 32px;
  }

  .gallery img {
    height: 410px;
  }

}

@media(max-width:720px) {
  .sidebar {
    transform: translateX(-100%);
    transition: .25s;
  }

  .sidebar.open {
    transform: none;
  }

  .menu-button {
    display: block;
    position: fixed;
    left: 14px;
    top: 14px;
    z-index: 30;
    width: 42px;
    height: 42px;
    border: 0;
    background: var(--accent);
    color: #fff;
    font-size: 22px;
  }

  main {
    margin-left: 0;
    padding: 0 16px 50px;
  }

  .hero {
    padding: 76px 8px 35px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .chapter {
    padding: 26px 20px;
  }

  .chapter-title h2 {
    font-size: 21px;
  }

  .steps>li {
    padding-left: 50px;
  }

  .steps>li:before {
    width: 32px;
    height: 32px;
  }

  .gallery img {
    height: 300px;
  }

  .link-gap {
    margin-left: 12px;
  }

  .inline-link {
    margin-left: 6px;
  }

}

/* OpcClaw modular rebuild */ .doc-module {
  max-width: 1080px;
  margin: 34px auto 54px;
  scroll-margin-top: 24px;
}

.module-heading {
  padding: 34px 38px;
  margin-bottom: 20px;
  border: 1px solid #dce6f2;
  border-radius: 16px;
  background: radial-gradient(circle at right top, rgba(34, 128, 226, .12), transparent 34%), linear-gradient(135deg, #ffffff, #f4f9ff);
  box-shadow: 0 10px 28px rgba(20, 52, 92, .06);
}

.module-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2.4px;
  color: #1e61ad;
  margin-bottom: 8px;
}

.module-heading h2 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 10px;
  color: #102033;
}

.module-heading p {
  max-width: 780px;
  margin: 0;
  color: #667085;
  font-size: 15px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.module-card {
  display: block;
  padding: 18px 18px 16px;
  border: 1px solid #dfe8f3;
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  color: #172033;
  box-shadow: 0 8px 24px rgba(17, 39, 68, .045);
  transition: .18s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: #9ec8ef;
  box-shadow: 0 12px 28px rgba(17, 39, 68, .08);
}

.module-card span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef7ff;
  color: #1e61ad;
  font-size: 11px;
  font-weight: 800;
}

.module-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.module-card p {
  margin: 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.6;
}

.doc-module.connectors .module-heading {
  background: radial-gradient(circle at right top, rgba(12, 138, 113, .14), transparent 34%), linear-gradient(135deg, #ffffff, #f2fffb);
}

.doc-module.connectors .module-kicker,
.doc-module.connectors .module-card span {
  color: #0c8a71;
}

.doc-module.connectors .module-card span {
  background: #eafaf6;
}

.doc-module.advanced .module-heading {
  background: radial-gradient(circle at right top, rgba(138, 75, 216, .16), transparent 34%), linear-gradient(135deg, #ffffff, #faf6ff);
}

.doc-module.advanced .module-kicker,
.doc-module.advanced .module-card span {
  color: #8a4bd8;
}

.doc-module.advanced .module-card span {
  background: #f5efff;
}

.sidebar a.module-main {
  margin-top: 12px;
  padding: 11px 12px;
  background: rgba(255,255,255,.055);
  border-color: rgba(255,255,255,.08);
  font-weight: 800;
  color: #f4fbff;
}

.sidebar a.sub-link {
  margin-left: 14px;
  padding: 7px 10px 7px 18px;
  font-size: 12px;
  color: #8fb1c8;
  border-left: 1px solid rgba(143,177,200,.24);
  border-radius: 0 5px 5px 0;
}

.sidebar a.sub-link.active {
  color: #ffffff;
  border-left-color: #55aaff;
}

.sidebar a.chapter-link {
  margin-top: 8px;
  padding: 9px 10px 9px 13px;
  font-size: 13px;
  font-weight: 800;
  color: #dcecf7;
  background: rgba(255,255,255,.025);
}

.sidebar a.topic-link {
  margin-left: 14px;
  padding: 7px 8px 7px 18px;
  font-size: 12px;
  color: #9fc0d6;
  border-left: 1px solid rgba(143,177,200,.28);
  border-radius: 0 5px 5px 0;
}

.sidebar a.detail-link {
  margin-left: 30px;
  padding: 5px 8px 5px 16px;
  font-size: 11px;
  line-height: 1.35;
  color: #7898ad;
  border-left: 1px dashed rgba(143,177,200,.24);
  border-radius: 0 5px 5px 0;
}

.sidebar a.topic-link::after,
.sidebar a.detail-link::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 6px;
  height: 1px;
  background: rgba(143,177,200,.45);
}

.sidebar a.topic-link.active,
.sidebar a.detail-link.active {
  color: #ffffff;
  border-left-color: #55aaff;
}

.nav-module {
  position: relative;
  margin: 14px 0 16px;
  padding: 10px 9px 12px;
  border: 1px solid rgba(255,255,255,.10);
  border-left: 4px solid #35c8ee;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.025)), rgba(5,16,29,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 22px rgba(0,0,0,.12);
}

.nav-module.has-active {
  border-color: rgba(85,170,255,.45);
  border-left-color: #55aaff;
  background: linear-gradient(180deg, rgba(64,139,216,.18), rgba(255,255,255,.03)), rgba(5,16,29,.34);
}

.nav-module.nav-connectors {
  border-left-color: #23d6ae;
}

.nav-module.nav-advanced {
  border-left-color: #b889ff;
}

.nav-module-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sidebar .nav-module-head a.module-main {
  flex: 1 1 auto;
  margin: 0;
  padding: 10px 10px;
  border-radius: 9px;
  background: rgba(255,255,255,.07);
  color: #ffffff;
  letter-spacing: .5px;
}

.nav-toggle {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #eaf8ff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.nav-toggle:hover {
  background: rgba(53,200,238,.18);
  border-color: rgba(53,200,238,.45);
}

.nav-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-top: 3px;
}

.nav-module.collapsed .nav-children {
  display: none;
}

.nav-module.collapsed {
  padding-bottom: 10px;
}

.nav-module.collapsed .nav-module-head {
  margin-bottom: 0;
}

.nav-module.collapsed .nav-toggle {
  color: #9fc0d6;
}

.doc-module > .module-heading {
  position: relative;
}

.doc-module > .module-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 28px;
  width: 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1e61ad, #17b5d1);
}

.chapter {
  border-radius: 16px;
}

.chapter-title {
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f6;
}

.chapter-title h2 {
  display: inline-block;
  padding: 4px 0;
}

.chapter h3 {
  position: relative;
  margin: 38px 0 18px;
  padding: 13px 16px 13px 18px;
  border-left: 5px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(30,97,173,.10), rgba(30,97,173,.03));
  color: #102033;
  font-size: 19px;
  font-weight: 850;
  scroll-margin-top: 28px;
}

.chapter h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 14px;
  padding: 8px 12px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #cfe0f1;
  border-radius: 999px;
  background: #f4f9ff;
  color: #1b4d7d;
  font-size: 15px;
  font-weight: 800;
  scroll-margin-top: 28px;
}

.chapter h4::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 0 4px rgba(23,181,209,.12);
  flex: 0 0 auto;
}

.permission-code-card {
  margin: 10px 0 18px;
  overflow: hidden;
  border: 1px solid #c9dcf0;
  border-radius: 14px;
  background: #0f1724;
  box-shadow: 0 12px 28px rgba(15,23,36,.12);
}

.permission-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(90deg, rgba(30,97,173,.95), rgba(23,181,209,.74));
  color: #fff;
}

.permission-code-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.permission-code-head span {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  line-height: 1.45;
}

.copy-code {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.copy-code:hover {
  background: rgba(255,255,255,.26);
}

.copy-code.copied {
  background: #16a36f;
  border-color: #8ff0c8;
}

.permission-code-tip {
  margin: 0;
  padding: 12px 16px 0;
  color: #a9bdd2;
  font-size: 13px;
  font-weight: 600;
}

.config-code {
  margin: 0;
  padding: 14px 16px 18px;
  overflow: auto;
  max-height: 520px;
  background: #0f1724;
  color: #d6e8ff;
  font: 13px/1.65 Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
  white-space: pre;
}

.config-code code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
}

@media (max-width: 900px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-heading {
    padding: 26px 24px;
  }

  .module-heading h2 {
    font-size: 28px;
  }

}
