:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --header-height: 64px;
    --footer-height: 56px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-light);
}

/* 页头 */
.doc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
}

.doc-header .logo svg {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

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

.version-badge {
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    color: #ffffff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.btn-home {
    padding: 8px 16px;
    background: var(--bg-light);
    color: var(--text-primary);
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-home:hover {
    background: var(--border-color);
}

/* 侧边栏 */
.doc-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height) - var(--footer-height));
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
    transition: transform 0.3s ease;
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    width: 40px;
    height: 40px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.sidebar-nav {
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 10px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.submenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: left;
    transition: all 0.2s ease;
}

.submenu-toggle:hover {
    color: var(--primary-color);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.submenu-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    background: var(--bg-light);
}

.submenu-toggle.active + .submenu {
    display: block;
}

.submenu .nav-link {
    padding-left: 40px;
    font-size: 13px;
}

.submenu .nav-link.active {
    background: rgba(99, 102, 241, 0.15);
}

/* 主内容区 */
.doc-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    margin-bottom: var(--footer-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

.content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 40px 80px;
}

.doc-section {
    margin-bottom: 60px;
    scroll-margin-top: calc(var(--header-height) + 20px);
}

.doc-section h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.doc-section h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 16px;
}

.doc-section h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

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

/* 信息框 */
.info-box {
    display: flex;
    gap: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* 功能网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0;
}

.feature-item {
    padding: 24px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 12px;
}

.feature-item h3 {
    font-size: 16px;
    margin: 0 0 8px;
}

.feature-item p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table td {
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.03);
}

/* 代码块 */
.code-block {
    margin: 16px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #1e293b;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #0f172a;
}

.code-lang {
    font-size: 12px;
    color: #94a3b8;
    font-family: monospace;
}

.copy-btn {
    padding: 4px 12px;
    background: #334155;
    color: #e2e8f0;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: #475569;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    margin: 0;
}

.code-block code {
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.6;
}

/* 步骤列表 */
.step-list {
    margin: 24px 0;
}

.step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin: 4px 0 8px;
    font-size: 16px;
}

.step-content p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* 注意事项 */
.note-box {
    padding: 14px 16px;
    background: rgba(99, 102, 241, 0.08);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.note-box strong {
    color: var(--primary-color);
}

/* 要求块 */
.req-block {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.req-block h3 {
    font-size: 15px;
    margin: 0 0 12px;
}

.req-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.req-list li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.req-list li:last-child {
    border-bottom: none;
}

/* 特性列表 */
.feature-list {
    margin: 16px 0;
}

.feature-detail {
    margin-bottom: 20px;
}

.feature-detail h3 {
    font-size: 15px;
    margin: 0 0 10px;
}

.feature-detail ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-detail li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* FAQ项目 */
.faq-item {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.faq-item h3 {
    font-size: 15px;
    margin: 0 0 12px;
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.faq-item ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.faq-item li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.faq-item li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--primary-color);
}

/* 页脚 */
.doc-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    z-index: 999;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-info {
    display: flex;
    gap: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .content-wrapper {
        padding: 32px 32px 80px;
    }
    
    .doc-section h1 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .doc-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .doc-sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .doc-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 24px 20px 80px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .info-box {
        flex-direction: column;
        gap: 12px;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 12px;
        padding: 12px 24px;
    }
    
    .footer-info,
    .footer-links {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 16px;
    }
    
    .doc-header .logo span {
        display: none;
    }
    
    .step-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .code-block code {
        font-size: 12px;
    }
}

/* 滚动条样式 */
.doc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.doc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.doc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.doc-sidebar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 850;
}

.sidebar-overlay.active {
    display: block;
}