/**
 * ALEStore - 文档页面样式
 * 专业版 - 悬停展开菜单 + SVG图标
 * 版本: v3 - 修复导航栏样式冲突
 */

/* 重要：所有样式仅作用于文档容器内部，不影响导航栏 */

/* 文档容器 */
.docs-container {
    display: flex;
    min-height: calc(100vh - 80px);
    background: #f8fafc;
    position: relative;
    box-sizing: border-box;
}

/* 仅对文档容器内的元素应用box-sizing */
.docs-container *,
.docs-container *::before,
.docs-container *::after {
    box-sizing: border-box;
}

/* ========================================
   左侧菜单
======================================== */
.sidebar {
    width: 80px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    overflow: visible;
    z-index: 1000;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.sidebar:hover {
    width: 280px;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar:hover .sidebar-header {
    opacity: 1;
}

.sidebar-header h2 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
}

.sidebar-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    white-space: nowrap;
}

.menu-list {
    padding: 20px 0;
}

.menu-item {
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    position: relative;
    white-space: nowrap;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: #3b82f6;
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    border-left-color: #3b82f6;
    color: white;
}

.menu-item .icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-item .icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.menu-item .text {
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 15px;
}

.sidebar:hover .menu-item .text {
    opacity: 1;
}

/* ========================================
   右侧内容区
======================================== */
.content-area {
    margin-left: 80px;
    flex: 1;
    padding: 48px;
    max-width: 1400px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-section {
    display: none;
    animation: fadeInUp 0.5s ease-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 40px;
}

.section-title {
    font-size: 42px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    line-height: 1.2;
}

.section-title .icon-wrapper {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.section-title .icon-wrapper svg {
    width: 32px;
    height: 32px;
    stroke: white;
    fill: none;
    stroke-width: 2;
}

.section-subtitle {
    font-size: 18px;
    color: #64748b;
    line-height: 1.6;
}

/* ========================================
   卡片和盒子
======================================== */
.card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.step-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #3b82f6;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
}

.step-box h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-number {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* ========================================
   代码块
======================================== */
.code-block {
    background: #1e293b;
    border-radius: 12px;
    padding: 20px;
    overflow-x: auto;
    position: relative;
    margin: 20px 0;
    border: 1px solid #334155;
}

.code-block code {
    color: #e2e8f0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   提示框
======================================== */
.alert {
    padding: 18px 20px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* ========================================
   标签页
======================================== */
.tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 32px;
}

.tab {
    padding: 14px 28px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 600;
    color: #64748b;
    background: none;
    border: none;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.tab svg {
    width: 18px;
    height: 18px;
}

.tab:hover {
    color: #3b82f6;
    background: #f8fafc;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
    background: #f8fafc;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   信息网格和卡片
======================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.info-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
}

.info-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.info-card h4 {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.info-card h4 svg {
    width: 20px;
    height: 20px;
    stroke: #3b82f6;
}

.info-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* ========================================
   FAQ
======================================== */
.faq-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.faq-question {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.3s;
    gap: 16px;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-question svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
    flex-shrink: 0;
    stroke: #64748b;
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s;
    color: #64748b;
    line-height: 1.8;
}

.faq-item.open .faq-answer {
    padding: 0 24px 20px;
    max-height: 800px;
}

.faq-item.open .faq-question svg {
    transform: rotate(180deg);
    stroke: #3b82f6;
}

/* ========================================
   响应式设计
======================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .sidebar:hover {
        width: 100%;
    }
    
    .sidebar-header {
        opacity: 1;
    }
    
    .menu-item .text {
        opacity: 1;
    }
    
    .content-area {
        margin-left: 0;
        padding: 24px;
    }
    
    .docs-container {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}
