/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 全局样式 */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --accent-color: #e74c3c;
    --text-color: #333;
    --white-color: #fff;
    --gray-color: #95a5a6;
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

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

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.primary-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: var(--light-color);
    color: var(--secondary-color);
    margin-left: 15px;
}

.secondary-btn:hover {
    background-color: var(--gray-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

/* 头部导航 */
header {
    background-color: var(--white-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 0 auto;
    max-width: 1200px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.menu-btn {
    display: none;
    cursor: pointer;
}

.menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 5px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 文档菜单图标旋转动画 */
.toggle-submenu.active {
    transform: rotate(45deg);
}

/* 代码块样式增强 */
.code-block {
     background-color: var(--secondary-color);
     color: var(--white-color);
     padding: 20px;
     border-radius: 8px;
     max-width: 100%;
     margin: 0 auto 30px;
     text-align: left;
     overflow-x: auto;
     position: relative;
 }

/* 英雄区域 */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px; /* 考虑固定导航栏高度 */
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero h1 {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.tagline {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 20px;
}

.description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: var(--dark-color);
}

/* 特性部分 */
.features {
    padding: 100px 0;
    background-color: var(--white-color);
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--light-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
    text-align: center;
    margin-bottom: 20px;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.feature-card.active {
    border: 2px solid var(--primary-color);
    transform: scale(1.02);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* 安装部分 */
.installation {
    padding: 100px 0;
    background-color: var(--light-color);
    text-align: center;
}

.installation h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
}



.code-block pre {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
}

/* 示例部分 */
.example {
    padding: 100px 0;
    background-color: var(--white-color);
    text-align: center;
}

.example h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
}

/* 下载部分 */
.download-content {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white-color);
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.download-content h2 {
    font-size: 2.8rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease;
}

.download-content p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease;
}

.download-content .btn {
    font-size: 1.2rem;
    padding: 15px 30px;
    animation: pulse 2s infinite;
}

.download-content .code-block {
    background-color: rgba(0, 0, 0, 0.3);
    margin: 30px auto;
    max-width: 600px;
    animation: fadeIn 1s ease;
}

.version-info {
    margin-top: 30px;
    font-style: italic;
    color: var(--light-color);
    opacity: 0.8;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.page-header {
    padding: 120px 0 60px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    text-align: center;
    margin-top: 80px;
}

.page-header h1 {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.page-header p {
    font-size: 1.2rem;
    color: var(--dark-color);
    max-width: 800px;
    margin: 0 auto;
}

.features-content {
    padding: 40px 0;
}

.feature-section {
    margin-bottom: 80px;
}

.feature-section h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--light-color);
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.spec-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--light-color);
}

.spec-name {
    flex: 1;
    font-weight: 600;
    color: var(--secondary-color);
}

.spec-value {
    flex: 2;
}

.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.use-case-item {
    background-color: var(--light-color);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.use-case-item h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.feature-example {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--gray-color);
}

.feature-example h4 {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.doc-container {
    display: flex;
    margin-top: 40px;
    min-height: calc(100vh - 40px);
}

.doc-sidebar {
    width: 320px;
    background-color: var(--white-color);
    border-right: 1px solid var(--light-color);
    padding: 20px 0;
    height: calc(100vh - 80px);
    position: sticky;
    top: 80px;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--light-color);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toggle-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.doc-menu {
    padding: 0 10px;
}

.menu-level-1 {
    list-style: none;
}

.menu-item {
    margin-bottom: 5px;
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding-right: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.menu-link:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.menu-link.active {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.has-children {
    position: relative;
}

.toggle-submenu {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    z-index: 1;
}

.toggle-submenu::before {
    content: "+";
    font-size: 12px;
}

.toggle-submenu.active::before {
    content: "-";
}

.doc-sidebar .menu-level-2 {
    list-style: none;
    display: none;
    position: relative;
    top: 0;
    left: 0;
    width: 100% !important;
    padding-left: 20px;
    margin-left: 0;
    border-left: 1px dashed var(--gray-color);
    background: var(--white-color);
    z-index: auto;
    box-sizing: border-box;
}

.menu-level-2 .menu-item {
    padding-left: 20px;
    border-left: 1px dashed var(--gray-color);
    margin-left: 0;
}

.menu-level-2.active {
    display: block;
}

.doc-content {
    flex: 1;
    padding: 40px 0;
}

.doc-section {
    margin-bottom: 60px;
}

.doc-section h1 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-color);
}

.doc-section h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin: 30px 0 15px;
}

.doc-section p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.doc-section ol,
.doc-section ul {
    margin-bottom: 20px;
    padding-left: 25px;
}

.doc-section li {
    margin-bottom: 10px;
}

.doc-placeholder {
    margin-top: 40px;
    padding: 40px;
    background-color: var(--light-color);
    border-radius: 8px;
    text-align: center;
}

.placeholder-content {
    max-width: 600px;
    margin: 0 auto;
}

/* 页脚 */
footer {
    background-color: var(--secondary-color);
    color: var(--white-color);
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.social-links {
    margin-top: 20px;
}

.social-links a {
    color: var(--white-color);
    margin: 0 10px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--gray-color);
}

/* 优化后的左侧菜单树样式 */
.simple-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.menu-parent > a {
    display: flex;
    align-items: center;
    padding: 15px 15px; /* 增加上下边距 */
    margin: 5px 0; /* 增加上下外边距 */
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    background-color: var(--white-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.menu-parent > a:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.menu-parent.active > a {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.sub-menu {
    list-style-type: none;
    padding-left: 20px;
    margin: 0;
    display: none;
    background-color: #f9f9f9;
}

.sub-menu li a {
    display: block;
    padding: 10px 15px; /* 增加上下边距 */
    margin: 3px 0; /* 增加上下外边距 */
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sub-menu li a:hover {
    color: var(--white-color);
    background-color: var(--primary-color);
}

.menu-parent.active .sub-menu {
    display: block;
}

/* 响应式设计 */

/* 优化使用文档页面排版 */
.doc-container {
  gap: 40px;
  padding: 0 20px;
}

.doc-sidebar {
  width: 280px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.doc-content {
  padding: 40px;
  background-color: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1024px) {
  .doc-container {
    flex-direction: column;
  }

  .doc-sidebar {
    width: 100%;
    position: static;
  }
}


@media (max-width: 768px) {
    .doc-container {
        flex-direction: column;
    }

    .doc-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--light-color);
    }

    .toggle-sidebar {
        display: block;
    }



    .doc-menu.active {
        display: block;
    }


    .hero h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1.2rem;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: var(--white-color);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 15px 0;
    }

    .menu-btn {
        display: block;
    }

    .features h2, .installation h2, .example h2, .download h2 {
        font-size: 2rem;
    }

    .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }

    .secondary-btn {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* 新增样式，确保窄屏或移动端文档目录显示 */
@media (max-width: 768px) {
  .doc-sidebar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}