/* =====================================================
   SDK 接口文档 - 视觉样式（青绿色系，区别于帮助中心紫色）
   ===================================================== */

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #2dd4bf;
  --primary-bg: #f0fdfa;
  --accent: #6366f1;
  --success: #10b981;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg-page: #f8fafc;
  --bg-white: #ffffff;
  --sidebar-width: 280px;
  --navbar-height: 64px;
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.06);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body.docs {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   顶部导航栏 —— 青绿渐变
   ===================================================== */
.docs-navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  background: linear-gradient(135deg, #042f2e 0%, #0f766e 50%, #0d9488 100%);
  box-shadow: 0 2px 20px rgba(13, 148, 136, .35);
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.docs-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 32px;
}

.docs-navbar-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #2dd4bf, #5eead4);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 0 3px rgba(45,212,191,.25);
}

.docs-navbar-brand .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.docs-navbar-brand .brand-name { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.docs-navbar-brand .brand-sub  { color: rgba(255,255,255,.55); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }

.docs-navbar-links { display: flex; align-items: center; gap: 4px; flex: 1; }

.docs-navbar-links a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all var(--transition);
  white-space: nowrap;
}
.docs-navbar-links a:hover { color: #fff; background: rgba(255,255,255,.12); }
.docs-navbar-links a.active { color: #fff; background: rgba(255,255,255,.18); }

/* SDK 专属：版本标签 */
.sdk-version-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(45,212,191,.25);
  border: 1px solid rgba(45,212,191,.4);
  color: #99f6e4;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .5px;
  margin-left: 8px;
  flex-shrink: 0;
}

.docs-navbar-search { margin-left: auto; position: relative; flex-shrink: 0; }
.docs-navbar-search input {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px; color: #fff; font-size: 13px;
  padding: 6px 14px 6px 36px; width: 200px; outline: none;
  transition: all var(--transition);
}
.docs-navbar-search input::placeholder { color: rgba(255,255,255,.5); }
.docs-navbar-search input:focus { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.4); width: 240px; }
.docs-navbar-search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.6); font-size: 13px; pointer-events: none; }

.docs-mobile-toggle {
  display: none; background: none; border: none; color: #fff;
  font-size: 20px; cursor: pointer; padding: 8px; border-radius: 6px;
  margin-left: auto; transition: background var(--transition);
}
.docs-mobile-toggle:hover { background: rgba(255,255,255,.12); }

/* =====================================================
   整体布局
   ===================================================== */
.docs-layout { display: flex; min-height: 100vh; padding-top: var(--navbar-height); }

/* =====================================================
   左侧边栏
   ===================================================== */
.docs-sidebar-wrap {
  width: var(--sidebar-width); flex-shrink: 0;
  position: fixed; top: var(--navbar-height); left: 0; bottom: 0;
  background: var(--bg-white); border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden; z-index: 100;
  transition: transform var(--transition);
  scrollbar-width: thin; scrollbar-color: #ddd transparent;
}
.docs-sidebar-wrap::-webkit-scrollbar { width: 4px; }
.docs-sidebar-wrap::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar-wrap::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.docs-sidebar-wrap::-webkit-scrollbar-thumb:hover { background: #bbb; }

.docs-sidebar-inner { padding: 20px 0 40px; }

.sidebar-search { padding: 0 16px 16px; border-bottom: 1px solid var(--border-light); margin-bottom: 8px; }
.sidebar-search input {
  width: 100%; background: var(--bg-page); border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; padding: 7px 12px 7px 32px;
  outline: none; color: var(--text-primary); transition: all var(--transition);
}
.sidebar-search input:focus {
  border-color: var(--primary-light); background: #fff;
  box-shadow: 0 0 0 3px rgba(13,148,136,.08);
}
.sidebar-search .si-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 12px; }
.sidebar-search-wrap { position: relative; }

/* ---- 菜单 ---- */
.menu-group { margin: 0; }

.menu-category { margin: 1px 0; }

.menu-category-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px; cursor: pointer;
  color: var(--text-secondary); font-size: 13.5px; font-weight: 600;
  transition: all var(--transition); user-select: none; position: relative;
}
.menu-category-header:hover { color: var(--primary); background: var(--primary-bg); }
.menu-category-header .cat-icon { font-size: 14px; width: 18px; text-align: center; color: var(--primary-light); flex-shrink: 0; }
.menu-category-header .cat-title { flex: 1; line-height: 1.4; }
.menu-category-header .cat-arrow { font-size: 11px; color: var(--text-muted); transition: transform var(--transition); flex-shrink: 0; }

.menu-category.open > .menu-category-header .cat-arrow { transform: rotate(90deg); color: var(--primary); }
.menu-category.open > .menu-category-header { color: var(--primary); }

.menu-children { display: none; overflow: hidden; }
.menu-category.open > .menu-children { display: block; }

.menu-item { display: block; position: relative; }

.menu-item-link {
  display: flex; align-items: center;
  padding: 7px 20px 7px 44px;
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none; transition: all var(--transition); line-height: 1.5; gap: 6px;
}
.menu-item-link:hover { color: var(--primary); background: var(--primary-bg); text-decoration: none; }
.menu-item-link.active {
  color: var(--primary);
  background: linear-gradient(90deg, var(--primary-bg) 0%, rgba(240,253,250,.4) 100%);
  font-weight: 600;
}
.menu-item-link.active::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; background: var(--primary); border-radius: 0 3px 3px 0;
}

.menu-sub-category { margin: 0; }

.menu-sub-header {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 20px 7px 40px; cursor: pointer;
  color: var(--text-secondary); font-size: 13px; font-weight: 600;
  transition: all var(--transition); user-select: none;
}
.menu-sub-header:hover { color: var(--primary); background: var(--primary-bg); }
.menu-sub-header .sub-arrow { font-size: 10px; color: var(--text-muted); transition: transform var(--transition); flex-shrink: 0; }

.menu-sub-category.open > .menu-sub-header .sub-arrow { transform: rotate(90deg); color: var(--primary); }
.menu-sub-category.open > .menu-sub-header { color: var(--primary); }

.menu-sub-children { display: none; }
.menu-sub-category.open > .menu-sub-children { display: block; }

.menu-level3 .menu-item-link { padding-left: 56px; }
.menu-level4 .menu-item-link { padding-left: 68px; }
.menu-level5 .menu-item-link { padding-left: 80px; }

.menu-doc-link {
  display: flex; align-items: center; gap: 8px; padding: 9px 20px;
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  text-decoration: none; transition: all var(--transition);
}
.menu-doc-link:hover { color: var(--primary); background: var(--primary-bg); text-decoration: none; }

/* =====================================================
   主内容区
   ===================================================== */
.docs-main { flex: 1; min-width: 0; margin-left: var(--sidebar-width); display: flex; }
.docs-content-wrap { flex: 1; min-width: 0; padding: 40px 48px; max-width: 900px; }

/* ---- 文章头部 ---- */
.docs-article-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.docs-article-header h1 { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.3; margin: 0 0 8px; letter-spacing: -.5px; }
.docs-article-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.docs-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; letter-spacing: .3px; }
.docs-badge-primary { background: var(--primary-bg); color: var(--primary); }
.docs-badge-accent  { background: #f5f3ff; color: #6366f1; }
.docs-badge-code    { background: #fefce8; color: #a16207; }

#md-editor-v3 { font-size: 15px; line-height: 1.8; color: var(--text-primary); }

/* ---- 首页 Hero ---- */
.docs-welcome { margin-bottom: 40px; }

.docs-welcome-hero {
  background: linear-gradient(135deg, #042f2e 0%, #0f766e 60%, #0d9488 100%);
  border-radius: var(--radius-lg); padding: 40px 48px;
  color: #fff; position: relative; overflow: hidden; margin-bottom: 32px;
}
.docs-welcome-hero::before {
  content: ''; position: absolute; top: -40%; right: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(45,212,191,.3) 0%, transparent 70%);
  border-radius: 50%;
}
.docs-welcome-hero::after {
  content: ''; position: absolute; bottom: -30%; right: 15%;
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(99,102,241,.2) 0%, transparent 70%);
  border-radius: 50%;
}
.docs-welcome-hero h2 { font-size: 26px; font-weight: 800; margin: 0 0 10px; position: relative; z-index: 1; }
.docs-welcome-hero p  { color: rgba(255,255,255,.75); font-size: 15px; margin: 0 0 24px; position: relative; z-index: 1; max-width: 520px; }

/* SDK 专属：技术标签栏 */
.sdk-tech-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  position: relative; z-index: 1; margin-bottom: 24px;
}
.sdk-tech-tag {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  color: rgba(255,255,255,.9); font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px; letter-spacing: .3px;
}

.docs-search-form { position: relative; z-index: 1; max-width: 480px; }
.docs-search-form .search-input-wrap {
  display: flex; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25); border-radius: 10px;
  overflow: hidden; backdrop-filter: blur(8px); transition: all var(--transition);
}
.docs-search-form .search-input-wrap:focus-within { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.5); box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.docs-search-form input { flex: 1; background: transparent; border: none; color: #fff; font-size: 14px; padding: 12px 16px; outline: none; }
.docs-search-form input::placeholder { color: rgba(255,255,255,.55); }
.docs-search-form button { background: rgba(255,255,255,.2); border: none; border-left: 1px solid rgba(255,255,255,.2); color: #fff; padding: 0 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background var(--transition); white-space: nowrap; }
.docs-search-form button:hover { background: rgba(255,255,255,.3); }

/* 快速入口 */
.docs-quick-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 32px; }

.docs-quick-card {
  background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; text-decoration: none; color: var(--text-primary);
  transition: all var(--transition); display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.docs-quick-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md), 0 0 0 3px rgba(13,148,136,.06); transform: translateY(-2px); text-decoration: none; color: var(--text-primary); }

.docs-quick-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.icon-bg-teal   { background: #f0fdfa; }
.icon-bg-cyan   { background: #ecfeff; }
.icon-bg-indigo { background: #eef2ff; }
.icon-bg-amber  { background: #fffbeb; }
.icon-bg-green  { background: #f0fdf4; }
.icon-bg-violet { background: #f5f3ff; }

.docs-quick-card h4 { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: var(--text-primary); }
.docs-quick-card p  { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.5; }

/* SDK 专属：接口方法标签 */
.sdk-method {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 800; padding: 2px 8px;
  border-radius: 4px; letter-spacing: .5px; font-family: monospace;
  margin-right: 6px; vertical-align: middle;
}
.sdk-method-get  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.sdk-method-post { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.sdk-method-put  { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.sdk-method-del  { background: #fff1f2; color: #e11d48; border: 1px solid #fecdd3; }

/* 搜索结果 */
#search-result { list-style: none; padding: 0; margin: 16px 0 0; }
#search-result li { border: none; padding: 0; margin-bottom: 8px; }
#search-result li a {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--bg-white); border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text-secondary); text-decoration: none; transition: all var(--transition);
}
#search-result li a::before { content: '\f1c9'; font-family: 'Font Awesome 5 Free'; font-weight: 900; font-size: 12px; color: var(--primary-light); flex-shrink: 0; }
#search-result li a:hover { border-color: var(--primary-light); color: var(--primary); background: var(--primary-bg); }

/* ---- 右侧 TOC ---- */
.docs-toc-wrap { width: 220px; flex-shrink: 0; padding: 40px 0; }
.docs-toc-inner { position: sticky; top: calc(var(--navbar-height) + 20px); padding-left: 20px; border-left: 2px solid var(--border); }
.docs-toc-inner h6 { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 12px; }
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-entry { display: block; margin-bottom: 2px; }
.toc-entry a { display: block; font-size: 12.5px; color: var(--text-muted); text-decoration: none; padding: 3px 0; line-height: 1.5; transition: color var(--transition); border-left: 2px solid transparent; margin-left: -22px; padding-left: 20px; }
.toc-entry a:hover { color: var(--primary); }
.toc-entry a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

/* =====================================================
   内容排版
   ===================================================== */
.docs-article h1 { font-size: 26px; font-weight: 800; margin: 0 0 24px; color: var(--text-primary); }
.docs-article h2 { font-size: 20px; font-weight: 700; margin: 40px 0 16px; color: var(--text-primary); padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.docs-article h3 { font-size: 17px; font-weight: 700; margin: 28px 0 12px; color: var(--text-primary); }
.docs-article h4 { font-size: 15px; font-weight: 700; margin: 20px 0 8px; color: var(--text-secondary); }
.docs-article p  { margin: 0 0 16px; color: var(--text-secondary); }
.docs-article a  { color: var(--primary); text-decoration: none; border-bottom: 1px solid rgba(13,148,136,.3); transition: all var(--transition); }
.docs-article a:hover { border-bottom-color: var(--primary); }
.docs-article ul, .docs-article ol { margin: 0 0 16px; padding-left: 24px; }
.docs-article li { margin-bottom: 6px; color: var(--text-secondary); }

.docs-article code { font-family: 'JetBrains Mono','Fira Code',Consolas,monospace; font-size: 13px; background: #f1f5f9; color: #0f766e; padding: 2px 6px; border-radius: 4px; border: 1px solid #e2e8f0; }
.docs-article pre { background: #0f172a; border-radius: var(--radius); padding: 20px; overflow-x: auto; margin: 0 0 20px; box-shadow: var(--shadow-md); }
.docs-article pre code { background: transparent; color: #e2e8f0; border: none; padding: 0; font-size: 13.5px; line-height: 1.7; }

.docs-article table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14px; }
.docs-article table th { background: #f8fafc; font-weight: 700; color: var(--text-primary); padding: 10px 14px; border: 1px solid var(--border); text-align: left; }
.docs-article table td { padding: 10px 14px; border: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; }
.docs-article table tr:nth-child(even) td { background: #fafbfc; }

.docs-article blockquote { border-left: 4px solid var(--primary-light); background: var(--primary-bg); padding: 14px 18px; margin: 0 0 20px; border-radius: 0 8px 8px 0; color: var(--text-secondary); font-size: 14px; }
.docs-article img { max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); margin: 8px 0; }
.docs-article hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* 面包屑 */
.docs-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap; }
.docs-breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.docs-breadcrumb a:hover { color: var(--primary); }
.docs-breadcrumb .sep { color: var(--border); }
.docs-breadcrumb .current { color: var(--text-secondary); font-weight: 500; }

/* 遮罩 */
.docs-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 99; backdrop-filter: blur(2px); }
.docs-overlay.show { display: block; }

/* =====================================================
   Preloader
   ===================================================== */
@keyframes hidePreloader { 0%{width:100%;height:100%} 100%{width:0;height:0} }
body > div.preloader { position:fixed; background:#fff; width:100%; height:100%; z-index:9999; opacity:0; transition:opacity .5s ease; overflow:hidden; pointer-events:none; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; }
body:not(.loaded) > div.preloader { opacity:1; }
body:not(.loaded) { overflow:hidden; }
body.loaded > div.preloader { animation:hidePreloader .5s linear .5s forwards; }
.preloader-spinner { width:40px; height:40px; border:3px solid var(--border); border-top-color:var(--primary); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
#apifm-md-editor-content { display:none; }

/* md-editor */
.md-editor-preview-wrapper { padding: 0 !important; }

/* =====================================================
   响应式
   ===================================================== */
@media (max-width: 1024px) {
  .docs-toc-wrap { display: none; }
  .docs-content-wrap { padding: 32px; max-width: 100%; }
}

@media (max-width: 768px) {
  .docs-navbar-links, .docs-navbar-search { display: none; }
  .docs-mobile-toggle { display: flex; }
  .docs-sidebar-wrap { transform: translateX(-100%); z-index: 200; top: 0; padding-top: var(--navbar-height); box-shadow: var(--shadow-lg); }
  .docs-sidebar-wrap.open { transform: translateX(0); }
  .docs-main { margin-left: 0; }
  .docs-content-wrap { padding: 24px 16px; }
  .docs-welcome-hero { padding: 28px 24px; }
  .docs-welcome-hero h2 { font-size: 20px; }
  .docs-quick-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .docs-article-header h1 { font-size: 22px; }
  .docs-navbar { padding: 0 16px; }
  .docs-navbar-brand .brand-text { display: none; }
  .sdk-tech-tags { display: none; }
}

@media (max-width: 480px) {
  .docs-quick-cards { grid-template-columns: 1fr; }
  .docs-content-wrap { padding: 20px 14px; }
}
