/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #ffd93d;
    --accent-color: #4ecdc4;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-active: rgba(255, 107, 107, 0.4);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.7;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

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

ul, ol {
    list-style-position: inside;
    margin-left: 1rem;
}

code {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--secondary-color);
    font-size: 0.9em;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.2rem 5%;
    background-color: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* 文档容器 */
.docs-container {
    display: flex;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    height: calc(100vh - 70px);
    position: sticky;
    top: 70px;
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

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

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.docs-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.docs-nav > li {
    margin: 0;
}

.docs-link {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.docs-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-card);
}

.docs-link.active {
    color: var(--primary-color);
    background-color: rgba(255, 107, 107, 0.1);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.docs-subnav {
    list-style: none;
    margin: 0;
    padding-left: 0.5rem;
}

.docs-subnav .docs-link {
    padding: 0.5rem 1.5rem 0.5rem 2rem;
    font-size: 0.88rem;
}

/* 文档主内容区 */
.docs-main {
    flex: 1;
    padding: 2rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.docs-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.docs-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.docs-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.docs-badges img {
    height: 20px;
}

.docs-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
}

/* 文档章节 */
.docs-section {
    margin-bottom: 3.5rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.subsection {
    margin: 2rem 0;
}

.subsection h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.subsection h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.2rem 0 0.8rem;
    color: var(--text-primary);
}

.docs-section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.docs-section ul, .docs-section ol {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.docs-section li {
    margin-bottom: 0.5rem;
}

/* 链接按钮组 */
.link-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.link-btn:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
}

/* 特性网格 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    border-color: var(--border-active);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

.feature-list-inline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}

.feature-list-inline li {
    background: var(--bg-card);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    margin: 0;
}

/* 代码块 */
.code-block {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.code-block pre {
    margin: 0;
}

.code-block code {
    background: transparent;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 公式块 */
.formula-block {
    background: rgba(0, 0, 0, 0.4);
    padding: 1.2rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 3px solid var(--accent-color);
    font-family: 'Courier New', monospace;
    color: var(--secondary-color);
    text-align: center;
}

.formula-block p {
    margin: 0.5rem 0;
    color: var(--secondary-color);
}

/* 信息提示框 */
.info-box, .warning-box {
    display: flex;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.info-box {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.warning-box {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.info-icon, .warning-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.info-icon {
    color: var(--accent-color);
}

.warning-icon {
    color: var(--primary-color);
}

.info-content, .warning-content {
    color: var(--text-secondary);
}

/* 表格 */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
}

.compare-table thead {
    background: rgba(255, 107, 107, 0.1);
}

.compare-table th, .compare-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.compare-table th {
    font-weight: 600;
    color: var(--primary-color);
}

.compare-table tbody tr:hover {
    background: var(--bg-card);
}

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

/* 对话示例 */
.chat-demo {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 85%;
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
}

.chat-message.user {
    background: rgba(255, 107, 107, 0.15);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-message.assistant {
    background: rgba(78, 205, 196, 0.15);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.chat-role {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* 参考文献 */
.reference-list {
    margin: 1rem 0;
}

.reference-list li {
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
}

.reference-list a {
    color: var(--accent-color);
}

/* 版本变更日志 */
.changelog-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.changelog-item:last-child {
    border-bottom: none;
}

.changelog-version {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-block;
}

.changelog-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-left: 1rem;
    display: inline-block;
}

.changelog-content {
    margin: 1rem 0 0 0;
}

/* FAQ */
.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    background: var(--bg-card);
    padding: 1.2rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
}

.faq-question i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.faq-answer {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.faq-answer p {
    margin-bottom: 0.8rem;
}

.faq-answer ol, .faq-answer ul {
    margin-bottom: 0;
}

/* 文档页脚 */
.docs-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.docs-footer a {
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-links.active {
        display: flex;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        padding: 1.5rem 5%;
        gap: 1rem;
        box-shadow: var(--shadow-md);
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .sidebar {
        position: fixed;
        left: -280px;
        z-index: 999;
        background: var(--bg-dark);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .docs-main {
        padding: 1.5rem 5%;
    }

    .docs-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .docs-header h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .subsection h3 {
        font-size: 1.2rem;
    }

    .link-group {
        flex-direction: column;
    }

    .link-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .docs-main {
        padding: 1rem 3%;
    }

    .docs-header h1 {
        font-size: 1.5rem;
    }

    .code-block {
        padding: 1rem;
    }

    .info-box, .warning-box {
        flex-direction: column;
        gap: 0.5rem;
    }
}