* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--font-family);
  color: var(--color-text-primary);
  line-height: 1.6;
  background: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
}
main {
  width: 100%;
  overflow-x: hidden;
}

.docs-index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px;
}

.docs-welcome { margin-bottom: 40px; }
.docs-welcome-card {
  position: relative;
  background: linear-gradient(135deg, #e8f7ff 0%, #f5f0ff 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  margin-bottom: 32px;
  overflow: hidden;
}
.docs-welcome-card::before,
.docs-welcome-card::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.docs-welcome-card::before {
  top: -100px; right: -100px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(15,174,255,0.20) 0%, transparent 65%);
}
.docs-welcome-card::after {
  bottom: -80px; left: -80px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(124,92,252,0.15) 0%, transparent 65%);
}
.docs-welcome-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #0090d9 0%, #0faeff 100%);
  border-radius: 50%;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: var(--shadow-feature);
}
.docs-welcome-icon svg {
  width: 36px; height: 36px;
}
.docs-welcome-icon svg path:nth-child(1) {
  fill: #fff;
}
.docs-welcome-icon svg path:nth-child(2),
.docs-welcome-icon svg path:nth-child(3) {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.docs-welcome-card h2 {
  position: relative;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 12px;
}
.docs-welcome-card p {
  position: relative;
  font-size: 15px;
  color: var(--color-text-secondary);
  margin: 0;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.doc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 28px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}
.doc-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.doc-card-icon {
  width: 56px; height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  transition: all 0.3s ease;
}
.doc-card:hover .doc-card-icon {
  background: linear-gradient(135deg, #0090d9 0%, #0faeff 100%);
  box-shadow: var(--shadow-feature);
}
.doc-card-icon svg {
  width: 28px; height: 28px;
}
.doc-card-icon svg path,
.doc-card-icon svg polyline,
.doc-card-icon svg line {
  fill: none;
  stroke: var(--color-primary-dark);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}
.doc-card:hover .doc-card-icon svg path,
.doc-card:hover .doc-card-icon svg polyline,
.doc-card:hover .doc-card-icon svg line {
  stroke: #fff;
}
.doc-card-more svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.doc-card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}
.doc-card-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
  line-height: 1.6;
}
.doc-card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary-dark);
  transition: gap 0.2s ease, color 0.2s ease;
  margin-top: auto;
}
.doc-card:hover .doc-card-more {
  gap: 10px;
  color: var(--color-primary);
}

.docs-detail-page {
  background: var(--color-bg-page);
  min-height: 100vh;
}
.docs-detail-breadcrumb {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}
.docs-detail-breadcrumb .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 13px;
  color: var(--color-text-secondary);
}
.docs-detail-breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.docs-detail-breadcrumb a:hover { color: var(--color-primary); }
.docs-detail-breadcrumb span {
  margin: 0 8px;
  color: var(--color-text-secondary);
}

.docs-detail-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}
.docs-sidebar {
  position: sticky;
  top: 20px;
  width: 100%;
  min-width: 0;
}
.docs-sidebar-inner {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  width: 100%;
}
.docs-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, #e8f7ff 0%, #fff 100%);
}
.docs-sidebar-header svg,
.docs-tree-arrow svg,
.docs-tree-icon svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.docs-sidebar-header svg {
  width: 20px; height: 20px;
  stroke: var(--color-primary);
  stroke-width: 2;
}
.docs-sidebar-nav {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 8px 0;
}
.docs-tree-group { margin-bottom: 2px; }
.docs-tree-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}
.docs-tree-title:hover { background: rgba(15,174,255,0.08); }
.docs-tree-arrow,
.docs-tree-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.docs-tree-arrow {
  width: 16px; height: 16px;
  transition: transform 0.2s ease;
  color: var(--color-text-muted);
}
.docs-tree-arrow svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  stroke-width: 2.5;
}
.docs-tree-group.open .docs-tree-arrow {
  transform: rotate(90deg);
  color: var(--color-primary);
}
.docs-tree-icon {
  width: 18px; height: 18px;
  color: var(--color-text-secondary);
}
.docs-tree-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor;
  stroke-width: 2;
}
.docs-tree-group.open .docs-tree-icon { color: var(--color-primary); }
.docs-tree-label {
  flex: 1;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.docs-tree-list {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.docs-tree-group.open .docs-tree-list { max-height: 1000px; }
.docs-tree-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 38px;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.docs-tree-link:hover,
.docs-tree-link.active {
  color: var(--color-primary);
  background: rgba(15,174,255,0.08);
}
.docs-tree-link.active {
  border-left-color: var(--color-primary);
  font-weight: 500;
}
.docs-tree-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.docs-tree-link:hover .docs-tree-dot,
.docs-tree-link.active .docs-tree-dot {
  background: var(--color-primary);
  width: 7px; height: 7px;
}
.docs-tree-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-article {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  box-shadow: var(--shadow-card);
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.docs-article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}
.docs-article-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
  word-break: break-word;
}
.docs-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.docs-article-content {
  font-size: 16px;
  line-height: 1.8;
  min-height: 600px;
  word-break: break-word;
}
.docs-article-content h1,
.docs-article-content h2,
.docs-article-content h3,
.docs-article-content h4 {
  margin: 32px 0 16px;
  font-weight: 600;
  line-height: 1.4;
}
.docs-article-content h1 { font-size: 28px; }
.docs-article-content h2 {
  font-size: 22px;
  border-left: 4px solid var(--color-primary);
  background: rgba(15,174,255,0.08);
  padding: 8px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.docs-article-content h3 { font-size: 20px; }
.docs-article-content h4 { font-size: 18px; }
.docs-article-content p { margin-bottom: 16px; }
.docs-article-content ul,
.docs-article-content ol {
  margin-bottom: 16px;
  padding-left: 28px;
}
.docs-article-content li { margin-bottom: 8px; }
.docs-article-content code {
  background: var(--color-bg-surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--color-primary-deeper);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.docs-article-content pre {
  background: #1a1a2e;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 20px;
}
.docs-article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.docs-article-content blockquote {
  border-left: 4px solid var(--color-primary);
  background: var(--color-primary-bg);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--color-text-secondary);
}
.docs-article-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 20px 0;
}
.docs-article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.docs-article-content th,
.docs-article-content td {
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  text-align: left;
}
.docs-article-content th {
  background: var(--color-primary-bg);
  font-weight: 600;
}
.docs-article-content a {
  color: var(--color-primary);
  text-decoration: none;
  transition: border-color 0.2s;
}
.docs-article-content a:hover { border-bottom-color: var(--color-primary); }

@media (max-width: 992px) {
  .docs-detail-container {
    grid-template-columns: 1fr;
    padding: 32px 20px;
  }
  .docs-sidebar { position: static; order: 2; }
  .docs-article { order: 1; padding: 28px 20px; }
  .docs-article-title { font-size: 24px; }
}
@media (max-width: 768px) {
  .docs-index-container { padding: 24px 16px; }
  .docs-grid { grid-template-columns: 1fr; }
  .docs-welcome-card { padding: 32px 20px; }
  .docs-welcome-card h2 { font-size: 22px; }
  .docs-detail-container { padding: 16px 12px; gap: 16px; }
  .docs-detail-breadcrumb .container { padding: 0 16px; }
  .docs-article { padding: 20px 16px; border-radius: var(--radius-md); }
  .docs-article-content { min-height: 0; }
  .docs-article-title { font-size: 20px; }
  .docs-article-content h1 { font-size: 22px; }
  .docs-article-content h2 { font-size: 18px; }
  .docs-article-content h3 { font-size: 16px; }
  .docs-article-content h4 { font-size: 15px; }
  .docs-article-content pre { padding: 12px; font-size: 12px; }
  .docs-article-content table { font-size: 12px; }
  .docs-article-content th,
  .docs-article-content td { padding: 6px 8px; }
  .docs-sidebar-inner { border-radius: var(--radius-md); }
}
