:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;

  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --primary: #1677ff;
  --primary-light: #eff6ff;
  --primary-hover: #1d4ed8;
  --primary-border: #bfdbfe;

  --success-bg: #ecfdf5;
  --success-text: #059669;
  --success-border: #a7f3d0;

  --warning-bg: #fffbeb;
  --warning-text: #d97706;
  --warning-border: #fde68a;

  --danger-bg: #fef2f2;
  --danger-text: #dc2626;
  --danger-border: #fecaca;

  --code-bg: #0d1117;
  --code-header: #161b22;
  --code-text: #e6edf3;
  --code-border: #30363d;

  --sidebar-w: 270px;
  --header-h: 60px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 顶部导航 Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 17px;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.brand-badge {
  font-size: 11px;
  background: #f1f5f9;
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.btn-header-action {
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}


.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-main);
}

/* 主布局 */
.layout-container {
  display: flex;
  min-height: calc(100vh - var(--header-h));
  position: relative;
}

/* 侧边栏 Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 20px 16px 40px;
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  padding: 6px 10px;
  margin-bottom: 4px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-item {
  margin-bottom: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.sidebar-link.active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.method-tag {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 6px;
}

.method-tag.post {
  background: #dbeafe;
  color: var(--primary);
}

.method-tag.get {
  background: #dcfce7;
  color: #15803d;
}

/* 内容单栏主区域 */
.main-wrapper {
  flex: 1;
  display: block;
  min-width: 0;
  padding: 40px 64px 80px;
  max-width: 1120px;
  margin: 0 auto;
}

.content-col {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

/* 兼容控制台嵌入式卡片 */
.console-card {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  color: var(--code-text);
  margin-top: 8px;
  margin-bottom: 24px;
}

/* 面包屑 & 标题区 */
.endpoint-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text-main);
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.endpoint-badge-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.http-method-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.http-method-badge.post {
  background: var(--primary);
  color: #ffffff;
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  background: var(--bg-subtle);
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

.idempotency-badge {
  font-size: 12px;
  font-weight: 600;
  color: #0284c7;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.desc-lead {
  font-size: 15px;
  color: #475569;
  margin-top: 16px;
  line-height: 1.7;
}

/* 提示卡片 Callouts */
.callout {
  margin: 24px 0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: 14px;
  line-height: 1.6;
}

.callout.info {
  background: var(--primary-light);
  border-color: var(--primary);
  color: #1e3a8a;
}

.callout.warning {
  background: var(--warning-bg);
  border-color: var(--warning-text);
  color: #78350f;
}

.callout.tip {
  background: var(--success-bg);
  border-color: var(--success-text);
  color: #064e3b;
}

.callout-title {
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 章节 */
.doc-section {
  margin-bottom: 44px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* 参数表格 */
.param-table-container {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.param-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.param-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.param-table tr:last-child td {
  border-bottom: none;
}

.param-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.param-nested-indent {
  color: var(--text-subtle);
  font-family: var(--font-mono);
  margin-right: 4px;
}

.type-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  margin-top: 4px;
  display: inline-block;
}

.tag-required {
  font-size: 10.5px;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fee2e2;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.tag-optional {
  font-size: 10.5px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.tag-conditional {
  font-size: 10.5px;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fef3c7;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

.param-desc {
  color: #334155;
  line-height: 1.6;
}

.param-default {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.param-default code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* 错误码卡片与表格 */
.error-badge-http {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.error-badge-http.s4xx {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.error-badge-http.s5xx {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.error-code-cell {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #dc2626;
}

.error-constant-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.error-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.error-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.error-code-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.error-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.error-desc {
  font-size: 12.5px;
  color: #475569;
  margin-top: 6px;
}

/* 控制台与代码高亮卡片 */
.console-card {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  color: var(--code-text);
}

.console-header {
  background: var(--code-header);
  padding: 10px 14px;
  border-bottom: 1px solid var(--code-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.console-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.console-tabs::-webkit-scrollbar {
  display: none;
}

.console-tab {
  background: transparent;
  border: none;
  color: #8b949e;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.console-tab:hover {
  color: #e6edf3;
  background: rgba(255, 255, 255, 0.06);
}

.console-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.btn-copy {
  background: transparent;
  border: 1px solid #30363d;
  color: #8b949e;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  flex: 0 0 auto;
  white-space: nowrap;
}

.btn-copy:hover {
  color: #ffffff;
  border-color: #8b949e;
  background: rgba(255, 255, 255, 0.05);
}

.btn-copy.copied {
  color: #3fb950;
  border-color: #3fb950;
}

.code-viewport {
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  max-height: 380px;
  scrollbar-width: thin;
  scrollbar-color: #30363d #0d1117;
}

.code-viewport pre {
  margin: 0;
}

/* 语法高亮样式 */
.tok-kw {
  color: #ff7b72;
  font-weight: 600;
}

.tok-str {
  color: #a5d6ff;
}

.tok-num {
  color: #79c0ff;
}

.tok-key {
  color: #7ee787;
}

.tok-comment {
  color: #8b949e;
  font-style: italic;
}

.tok-bool {
  color: #ff7b72;
  font-weight: 600;
}

.tok-func {
  color: #d2a8ff;
}

/* 响应预览卡片 */
.status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.status-pill.s200 {
  background: rgba(46, 160, 67, 0.2);
  color: #3fb950;
}

.status-pill.s400 {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.status-pill.s409 {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

/* 响应式支持 */
@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: block;
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: -100%;
    z-index: 99;
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    left: 0;
  }

  .main-wrapper {
    padding: 32px 32px 60px;
  }

  .param-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .param-table {
    min-width: 640px;
  }
}

@media (max-width: 768px) {
  .main-wrapper {
    padding: 24px 16px 48px;
  }

  .site-header {
    padding: 0 16px;
  }

  .header-right .nav-link {
    display: none;
  }

  .brand-badge {
    display: none;
  }

  .param-table {
    min-width: 600px;
  }

  .endpoint-badge-bar {
    align-items: flex-start;
  }

  .endpoint-path {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* SDK 下载卡片网格 */
.sdk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin: 24px 0 36px;
}

.sdk-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.sdk-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.08);
  transform: translateY(-2px);
}

.sdk-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sdk-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
}

.sdk-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.sdk-desc {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 16px;
}

.sdk-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.sdk-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-sdk-status {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tag-sdk-status.ready {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.tag-sdk-status.coming {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.btn-download-sdk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.btn-download-sdk:hover {
  background: var(--primary-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-download-sdk.disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  pointer-events: none;
}

/* 快速上手步骤样式 */
.qs-step-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 24px 0 40px;
}

.qs-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.qs-step-card:hover {
  border-color: #cbd5e1;
}

.qs-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.qs-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qs-step-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.qs-step-body {
  padding-left: 46px;
  font-size: 14px;
  color: #475569;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .qs-step-body {
    padding-left: 0;
  }
}