﻿:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #172033;
  --muted: #64748b;
  --line: #d9e1eb;
  --accent: #f28c28;
  --accent-soft: #fff3e7;
  --accent-strong: #d96f11;
  --blue: #1e5aa8;
  --green: #18845f;
  --shadow: 0 18px 50px rgba(20, 34, 55, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.75; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #193154;
  font-family: "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
  font-size: 0.92em;
  padding: 0.08rem 0.32rem;
}

pre {
  margin: 1rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid #1d2c43;
  border-radius: 8px;
  background: #101827;
  box-shadow: var(--shadow);
}
pre code {
  display: block;
  border: 0;
  background: transparent;
  color: #dce7f7;
  font-size: 0.88rem;
  line-height: 1.65;
  padding: 1rem;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
  border-bottom: 1px solid rgba(217, 225, 235, 0.9);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 2rem;
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  min-width: 230px;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
}
.brand:hover { text-decoration: none; }
.brand img { width: 52px; height: 40px; object-fit: contain; }
.brand span { display: flex; flex-direction: column; gap: 0.05rem; }
.brand strong { font-size: 1rem; line-height: 1.1; }
.brand small { color: var(--muted); font-size: 0.78rem; }

.topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  color: #344255;
  font-size: 0.92rem;
}
.topnav a {
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  color: #344255;
}
.topnav a:hover { background: var(--surface-soft); color: var(--blue); text-decoration: none; }
.topnav a.active { color: var(--accent-strong); background: var(--accent-soft); }

.menu-button {
  display: none;
  width: 38px;
  height: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.menu-button span { width: 18px; height: 2px; background: var(--text); }

/* Shell */
.shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2rem;
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 92px;
  height: calc(100vh - 116px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.sidebar-home,
.sidebar-section,
.sidebar-child {
  display: block;
  border-radius: 6px;
  color: inherit;
}
.sidebar a:hover { text-decoration: none; }
.sidebar-home {
  margin-bottom: 0.8rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
}
.sidebar-group { margin-top: 0.9rem; }
.sidebar-section {
  color: #1f2a3a;
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.45rem 0.6rem;
}
.sidebar-section.muted { cursor: default; }
.sidebar-child {
  color: #45556d;
  font-size: 0.88rem;
  padding: 0.34rem 0.6rem 0.34rem 1.15rem;
}
.sidebar a:hover,
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* Content */
.content { min-width: 0; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent-strong); text-decoration: none; }
.breadcrumb span.sep { opacity: 0.5; }
.breadcrumb span.current { color: var(--text); font-weight: 600; }

.hero,
.page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: stretch;
  padding: 0;
}
.hero-copy { padding: 2rem; }
.hero-panel {
  display: grid;
  align-content: center;
  gap: 0.55rem;
  padding: 1.4rem;
  border-left: 1px solid var(--line);
  background: var(--surface-soft);
}
.hero-panel span { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.hero-panel code { display: block; overflow-x: auto; padding: 0.55rem 0.65rem; }

.eyebrow,
.section-heading p {
  margin: 0 0 0.4rem;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1, h2, h3 { margin: 0; letter-spacing: 0; line-height: 1.25; }
h1 { max-width: 800px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { margin-top: 1.8rem; font-size: 1.45rem; }
h3 { margin-top: 1.4rem; font-size: 1.1rem; }
.page p { margin: 0.6rem 0; }
.page-heading h1 { margin-bottom: 0.25rem; }

.page img,
.page svg.figure {
  display: block;
  max-width: 100%;
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.page figure {
  margin: 1.25rem 0;
}
.page figure img,
.page figure svg {
  margin: 0;
}
.page figcaption {
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.section-heading { margin-bottom: 1.25rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.step,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
  display: block;
  color: inherit;
}
a.card:hover,
a.step:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(242, 140, 40, 0.12);
}
.step span.num {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #e9f2ff;
  color: var(--blue);
  font-weight: 800;
}
.step h3, .card h3 { margin-top: 0.8rem; }
.step p, .card p { margin-bottom: 0; color: #53647a; font-size: 0.94rem; }

.callout,
.warning,
.tip {
  display: block;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}
.callout {
  border: 1px solid #bfd7fb;
  background: #eff6ff;
  color: #24466f;
}
.warning {
  border: 1px solid #f6c788;
  background: #fff7ed;
  color: #7a3f09;
}
.tip {
  border: 1px solid #b6e3cf;
  background: #ecfdf5;
  color: #115e44;
}
.callout strong, .warning strong, .tip strong { font-weight: 700; }
.callout p:first-child, .warning p:first-child, .tip p:first-child { margin-top: 0; }
.callout p:last-child, .warning p:last-child, .tip p:last-child { margin-bottom: 0; }

ol.ordered,
ul.list {
  margin: 1rem 0;
  padding-left: 1.4rem;
}
ol.ordered li,
ul.list li { margin: 0.4rem 0; }
ul.compact li { margin: 0.25rem 0; }

.grid {
  display: grid;
  gap: 1rem;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

table.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}
table.table th,
table.table td {
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  text-align: left;
  vertical-align: top;
}
table.table th {
  background: var(--surface-soft);
  font-weight: 700;
}

.tabs {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.tabs-nav button {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs-nav button:hover { background: #fff; color: var(--text); }
.tabs-nav button.active {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
  background: #fff;
}
.tab-panel { padding: 1.5rem; }
.tab-panel:not(.active) { display: none; }
.tab-panel > h3:first-child { margin-top: 0; }

/* Nested sidebar (submenu) */
.sidebar-subhead {
  display: block;
  margin-top: 0.2rem;
  color: #1f2a3a;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0.4rem 0.6rem 0.15rem;
}
.sidebar-child.nested { padding-left: 1.7rem; }

/* API playground */
.api-playground {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.api-endpoint {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.api-method {
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
}
.api-method.post { background: var(--green); }
.api-method.get { background: var(--blue); }
.api-path {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0;
}
.api-try-btn {
  margin-left: auto;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 0.95rem;
}
.api-try-btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.table-try-btn {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}
.table-try-btn:hover {
  background: var(--accent-soft);
}
.api-playground .tabs-nav {
  background: #fff;
  flex-wrap: wrap;
}
.api-playground .tabs-nav button { flex: 0 0 auto; padding: 0.6rem 1rem; }
.api-playground .tab-panel { padding: 0; }
.api-playground .tab-panel pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.api-try-panel {
  border-top: 1px solid var(--line);
  padding: 1rem;
  background: var(--surface-soft);
  display: grid;
  gap: 0.7rem;
}
.api-try-panel[hidden] { display: none; }
.api-try-field { display: grid; gap: 0.3rem; }
.api-try-field span { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.api-try-panel input,
.api-try-panel select,
.api-try-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
}
.api-try-panel select {
  min-height: 2.35rem;
}
.api-try-panel textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.api-try-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.api-send {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 1.1rem;
}
.api-send:hover { background: var(--accent-strong); }
.api-send:disabled { opacity: 0.6; cursor: default; }
.api-try-hint { color: var(--muted); font-size: 0.8rem; }
.api-response {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  padding: 1rem;
  border: 1px solid #1d2c43;
  border-radius: 8px;
  background: #101827;
  color: #dce7f7;
  font-family: "JetBrains Mono", Consolas, "SFMono-Regular", monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.api-response code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.api-response-link {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--text);
}
.api-response-link[hidden] { display: none; }
.api-response-link a { font-weight: 700; }
.api-response-link span { color: var(--muted); font-size: 0.85rem; }
.api-response:empty { display: none; }

.api-feature {
  margin: 1.8rem 0;
}
.api-feature > h3 {
  margin-bottom: 0.45rem;
}
.api-feature > p {
  margin-top: 0;
}
.api-feature .api-playground {
  margin-top: 0.9rem;
}
.api-feature .api-try-panel {
  padding: 1.1rem;
}
.api-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}
.api-param-grid .api-field-wide {
  grid-column: span 2;
}
.api-feature .api-try-panel textarea {
  min-height: 340px;
  max-height: 620px;
  overflow: auto;
}

@media (max-width: 720px) {
  .asset-action-table,
  .asset-action-table tbody,
  .asset-action-table tr,
  .asset-action-table td {
    display: block;
    width: 100%;
  }
  .asset-action-table thead,
  .asset-action-table td:nth-child(3),
  .asset-action-table td:nth-child(4) {
    display: none;
  }
  .asset-action-table tr {
    margin-bottom: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.7rem;
  }
  .asset-action-table td {
    border: 0;
    padding: 0.2rem 0;
    overflow-wrap: anywhere;
  }
  .asset-action-table td:first-child {
    font-weight: 700;
  }
  .asset-action-table td:last-child {
    padding-top: 0.5rem;
  }
  .api-endpoint {
    align-items: flex-start;
  }
  .api-path {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .api-try-btn {
    margin-left: 0;
    width: 100%;
  }
  .api-feature .api-try-panel textarea {
    min-height: 300px;
  }
  .api-param-grid {
    grid-template-columns: 1fr;
  }
  .api-param-grid .api-field-wide {
    grid-column: auto;
  }
}

.ccswitch-intro {
  margin: 1.25rem 0 1.5rem;
}
.ccswitch-intro h3 {
  margin-top: 0;
}
.ccswitch-badges,
.ccswitch-trend {
  margin: 0.9rem 0;
}
.page .ccswitch-badges img,
.page .ccswitch-trend img {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin: 0.12rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.page .ccswitch-trend img {
  width: 250px;
  height: 55px;
}
.ccswitch-feature-list li {
  margin: 0.35rem 0;
}
.hint-container {
  display: block;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
}
.hint-container-title {
  margin: 0 0 0.35rem;
  font-weight: 700;
}
.hint-container.tip {
  border: 1px solid #b6e3cf;
  background: #ecfdf5;
  color: #115e44;
}
.hint-container.warning,
.hint-container.important {
  border: 1px solid #f6c788;
  background: #fff7ed;
  color: #7a3f09;
}
.hint-container p:first-child { margin-top: 0; }
.hint-container p:last-child { margin-bottom: 0; }

.vp-tabs {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.vp-tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.vp-tab-nav {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.vp-tab-nav:hover {
  background: #fff;
  color: var(--text);
}
.vp-tab-nav.active {
  border-bottom-color: var(--accent);
  background: #fff;
  color: var(--accent-strong);
}
.vp-tab {
  padding: 1.5rem;
}
.vp-tab:not(.active) {
  display: none;
}
.vp-tab-title {
  display: none;
}

.faq { display: grid; gap: 0.75rem; }
details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.9rem 1rem;
}
summary { cursor: pointer; font-weight: 700; }
details p { margin-bottom: 0; color: #53647a; }

.page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.page-nav a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.85rem 1rem;
  color: inherit;
}
.page-nav a:hover {
  border-color: var(--accent);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(242, 140, 40, 0.1);
}
.page-nav .pn-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-nav .pn-title {
  display: block;
  margin-top: 0.25rem;
  color: var(--accent-strong);
  font-weight: 700;
}
.page-nav .next { text-align: right; }
.page-nav .placeholder { visibility: hidden; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 1.5rem;
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-panel { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .topbar { padding: 0 1rem; }
  .topnav { display: none; }
  .menu-button { display: inline-flex; }
  .shell { grid-template-columns: 1fr; padding: 1rem; }
  .sidebar {
    position: fixed;
    inset: 68px 0 auto;
    z-index: 15;
    display: none;
    height: auto;
    max-height: calc(100vh - 68px);
    border-radius: 0;
  }
  body.sidebar-open .sidebar { display: block; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .brand { min-width: 0; }
  .brand small { display: none; }
  .hero-copy, .page { padding: 1.25rem; }
  .steps { grid-template-columns: 1fr; }
  .page-nav { grid-template-columns: 1fr; }
  .page-nav .next { text-align: left; }
  h1 { font-size: 1.8rem; }
}
