:root {
    --primary-color: #2563EB;
    --primary-dark: #1D4ED8;
    --text-color: #1E293B;
    --text-secondary: #64748B;
    --bg-color: #F8FAFC;
    --white: #FFFFFF;
    --border-color: #E2E8F0;
    --sidebar-width: 280px;
    --header-height: 64px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

/* 顶部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
}

.logo img {
    border-radius: 6px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

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

/* 主体布局 */
.main-wrapper {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 900;
}

.sidebar-nav {
    padding: 24px;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.nav-item {
    display: block;
    padding: 8px 12px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-sub-item {
    padding-left: 2rem;
    font-size: 0.9rem;
    display: block;
    padding: 6px 12px 6px 32px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-sub-item:hover {
    background-color: #EFF6FF;
    color: var(--primary-color);
}

.nav-sub-item.active {
    background-color: #EFF6FF;
    color: var(--primary-color);
    font-weight: 500;
}

.nav-item:hover {
    background-color: #EFF6FF;
    color: var(--primary-color);
}

.nav-item.active {
    background-color: #EFF6FF;
    color: var(--primary-color);
    font-weight: 500;
}

/* 内容区 */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    max-width: 100%;
}

.content-container {
    max-width: 900px;
    margin: 0 auto;
}

.intro-section {
    margin-bottom: 40px;
}

.intro-section h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--text-color);
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Hero Actions */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 1rem;
}

.action-button.brand, .action-button.primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: 1px solid var(--primary-color);
}

.action-button.brand:hover, .action-button.primary:hover {
    background-color: var(--primary-dark);
}

.action-button.alt, .action-button.secondary, .action-button.outline {
    background-color: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.action-button.alt:hover, .action-button.secondary:hover, .action-button.outline:hover {
    background-color: #F1F5F9;
    border-color: #CBD5E1;
}

/* Features Grid Section */
.features-grid-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin: 40px 0;
}

.feature-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.feature-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-details {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer Links */
.footer-links {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-links img {
    max-width: 200px;
    margin-top: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 40px 0;
}

/* 章节样式 */
.doc-section {
    margin-bottom: 60px;
    scroll-margin-top: 100px; /* 锚点偏移 */
}

.doc-section h2 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.doc-section h2 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* 左右分栏布局 */
.split-layout {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    align-items: flex-start;
}

.photo-column {
    flex: 0 0 480px; /* 进一步放大以清晰展示截图 (从 317px 放大约 1.5倍) */
    position: sticky;
    top: 100px;
}

.vertical-photo-placeholder {
    width: 100%;
    height: 480px;
    background: #F1F5F9;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    gap: 12px;
}

.vertical-photo-placeholder i {
    font-size: 3rem;
    opacity: 0.5;
}

.vertical-photo {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.content-column {
    flex: 1;
}

@media (max-width: 768px) {
    .split-layout {
        flex-direction: column;
    }
    .photo-column {
        flex: none;
        width: 100%;
        position: static;
    }
    .vertical-photo-placeholder {
        height: 200px;
    }
}

.feature-block {
    position: relative;
    margin-bottom: 32px;
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.block-header-icons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
}

.block-header-icons img {
    height: 48px; /* 放大 1.5 倍 (从 32px 到 48px) */
    width: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.block-footer-icons {
    position: absolute;
    bottom: -5px; /* 再下移 15px (从 10px 减到 -5px) */
    right: 20px;
}

.block-footer-icons img {
    height: 48px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.feature-block h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--text-color);
}

.step-guide ol {
    padding-left: 20px;
}

.step-guide li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.inline-icon {
    height: 36px; /* 放大 1.5 倍 (从 24px 到 36px) */
    width: auto;
    vertical-align: middle;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.layout-preview-images {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.layout-preview-images img {
    height: 120px; /* 放大 1.5 倍 (从 80px 到 120px) */
    width: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.param-table, .key-table {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 0.9rem;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.info-box {
    background-color: #EFF6FF;
    color: #1E40AF;
}

.warning-box {
    background-color: #FFF7ED;
    color: #9A3412;
    border-left: 4px solid #F97316;
}

/* 表格样式 */
.param-table, .key-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

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

.param-table th {
    background-color: #F8FAFC;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.param-table td:first-child {
    white-space: nowrap;
    font-weight: 500;
    vertical-align: top;
}

/* 卡片演示网格 */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card-demo {
    text-align: center;
}

.card-demo h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.card-demo p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.mock-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 100px;
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 12px;
    box-shadow: var(--shadow);
}

.mock-card.large {
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.mock-card.info {
    justify-content: center;
}

.mock-icon {
    width: 40px;
    height: 40px;
    background: #EFF6FF;
    border-radius: 8px;
}

.mock-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mock-text .line {
    height: 8px;
    background: #F1F5F9;
    border-radius: 4px;
}

.mock-text .title { width: 80%; }
.mock-text .desc { width: 50%; }

.mock-image {
    width: 100%;
    height: 60%;
    background: #CBD5E1;
}

.mock-overlay {
    width: 100%;
    height: 40%;
    background: white;
}

.mock-chart {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 4px solid #EFF6FF;
    border-top-color: var(--primary-color);
}

.check-list {
    list-style: none;
}

.check-list li {
    margin-bottom: 8px;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.check-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: #10B981;
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9rem;
}

/* 功能块内弹性布局 */
.feature-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.feature-flex-text {
    flex: 1;
}

.feature-flex-image {
    flex: 0 0 240px;
}

.feature-flex-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .feature-flex {
        flex-direction: column;
    }
    .feature-flex-image {
        flex: none;
        width: 100%;
    }
}

/* 组件列表 */
.component-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.comp-item {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.comp-item h4 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comp-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

kbd {
    background-color: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    font-family: monospace;
}

details {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
}

details p {
    margin-top: 12px;
    color: var(--text-secondary);
    padding-left: 16px;
    border-left: 2px solid var(--primary-color);
}

/* Sub-features style */
.sub-feature {
    margin-top: 16px;
    padding: 16px;
    background-color: #F8FAFC;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.sub-feature h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 600;
}

/* Utility classes */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.text-sm { font-size: 0.875rem; }
.text-gray-600 { color: #4B5563; }

/* 响应式设计 */
@media (max-width: 992px) {
    .content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }
    
    .header-link {
        display: none;
    }
}

/* Carousel Styles */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 40px auto;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #000;
    aspect-ratio: 16/9; /* 固定宽高比，防止高度塌陷或跳动 */
}

/* 代码块容器 */
.code-block-wrapper {
    position: relative;
    margin: 1rem 0;
}

.code-block-wrapper pre {
    margin: 0;
    padding: 1.25rem;
    background-color: #1e293b;
    color: #f8fafc;
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.5;
}

.code-block-wrapper code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

/* 复制按钮 */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.copy-button i {
    font-size: 0.85rem;
}

.copy-button.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%; /* 充满容器高度 */
}

.carousel-slide {
    min-width: 100%;
    height: 100%; /* 充满容器高度 */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000; /* 背景色 */
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain; /* 保持比例完整显示 */
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 10;
}

.carousel-button:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-button.prev {
    left: 20px;
}

.carousel-button.next {
    right: 20px;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: white;
}
