/* 文档导航项 */
.doc-nav-item {
    transition: all 0.3s ease;
}
.doc-nav-item:hover {
    background: rgba(0, 204, 128, 0.05) !important;
}
.doc-nav-item.active {
    background: rgba(0, 204, 128, 0.1);
    border-left: 3px solid var(--primary-color);
}

/* 文档分类 header hover */
.doc-category-header:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}
.doc-category-header:active {
    transform: scale(0.98);
}
.doc-tab-content {
    animation: fadeIn 0.3s ease;
}

/* 文档文章过渡动画 */
.doc-article {
    animation: fadeIn 0.3s ease;
}

/* 子菜单项 hover 效果 */
.doc-submenu-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* 文档容器卡片 */
.doc-card {
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}
.doc-card-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* 文档布局：左侧导航 + 右侧内容 */
.doc-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    min-height: 600px;
}

/* 左侧 sticky 导航 */
.doc-nav-sticky {
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* 分类块 */
.doc-category-block {
    margin-bottom: 0.8rem;
}

/* 分类 header - Unity（激活态） */
.doc-category-header-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(0, 204, 128, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 204, 128, 0.2);
}
/* 分类 header - 默认态 */
.doc-category-header-default {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.doc-category-name {
    font-weight: 700;
    font-size: 1rem;
}
.doc-category-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.doc-coming-soon {
    padding: 0.2rem 0.6rem;
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning-color);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* 子菜单 */
.doc-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0.5rem;
    margin-left: 1rem;
}
.doc-submenu-collapsed { max-height: 0; }
.doc-submenu-expanded  { max-height: 500px; }

/* 子菜单项 */
.doc-submenu-item {
    padding: 0.7rem 1rem;
    margin-bottom: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}
.doc-submenu-item.active {
    border-left-color: var(--primary-color);
    background: rgba(0, 204, 128, 0.1);
}
.doc-submenu-item-sm {
    padding: 0.45rem 1rem;
    margin-bottom: 0.15rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 二级分类 */
.doc-sub-category {
    padding: 0.7rem 1rem;
    margin-bottom: 0.3rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.doc-sub-category-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}
.doc-sub-expand-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.3s;
}
.doc-sub-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-left: 0.8rem;
    margin-bottom: 0.2rem;
}

/* 右侧内容区 */
.doc-content-area {
    padding-left: 1rem;
    min-width: 0;
    min-height: 600px;
}

/* 空文档占位 */
.doc-empty {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
}
.doc-empty-icon {
    opacity: 0.5;
    margin: 0 auto 1rem;
}
.doc-empty-text {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

@media (max-width: 900px) {
    .doc-layout {
        grid-template-columns: 1fr;
    }
    .doc-nav-sticky {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-right: 0;
        padding-bottom: 1rem;
    }
}

/* ============================================================
   侧边栏：WIP（文档编写中）小徽章
   ============================================================ */
.doc-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.doc-submenu-badge-wip {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(255, 170, 0, 0.12);
    color: #ffc966;
    border: 1px solid rgba(255, 170, 0, 0.25);
    flex-shrink: 0;
}

/* ============================================================
   MagicAI 集成 · 占位页（.magicai-placeholder）
   ============================================================ */
.magicai-placeholder {
    max-width: 720px;
    margin: 2rem auto;
    padding: 3rem 2.2rem;
    text-align: center;
    background: linear-gradient(160deg, rgba(71, 140, 191, 0.08) 0%, rgba(120, 180, 255, 0.02) 50%, rgba(180, 120, 220, 0.06) 100%);
    border: 1px solid rgba(120, 180, 255, 0.15);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}
.magicai-placeholder::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(120, 180, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}
.magicai-placeholder::after {
    content: "";
    position: absolute;
    bottom: -80px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 120, 220, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.mp-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(120, 180, 255, 0.18), rgba(180, 120, 220, 0.14));
    color: #9fc5ff;
    box-shadow: 0 10px 30px rgba(100, 160, 255, 0.15);
    position: relative;
    z-index: 1;
}
.mp-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.9rem 0;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}
.mp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    background: rgba(255, 170, 0, 0.1);
    color: #ffc966;
    border: 1px solid rgba(255, 170, 0, 0.28);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 1.3rem;
    position: relative;
    z-index: 1;
}
.mp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffc966;
    box-shadow: 0 0 8px rgba(255, 200, 100, 0.6);
    animation: mp-pulse 1.8s ease-in-out infinite;
}
@keyframes mp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.85); }
}
.mp-desc {
    font-size: 1rem;
    line-height: 1.75;
    color: rgba(200, 210, 230, 0.88);
    max-width: 560px;
    margin: 0 auto 2.2rem;
    position: relative;
    z-index: 1;
}
.mp-desc strong {
    color: #9fdfff;
    font-weight: 700;
}

/* 预告内容列表 */
.mp-preview {
    text-align: left;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.8rem;
    position: relative;
    z-index: 1;
}
.mp-preview-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(160, 180, 210, 0.7);
    margin-bottom: 1rem;
}
.mp-preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.mp-preview-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.mp-preview-list li:last-child {
    border-bottom: none;
}
.mp-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(120, 180, 255, 0.2), rgba(180, 120, 220, 0.15));
    color: #b5d4ff;
    font-size: 0.78rem;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: 0;
}
.mp-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}
.mp-item-desc {
    font-size: 0.8rem;
    color: rgba(160, 170, 190, 0.78);
    line-height: 1.55;
    margin-top: 0.15rem;
}

.mp-actions {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
.mp-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 600px) {
    .magicai-placeholder {
        padding: 2.2rem 1.2rem;
    }
    .mp-title {
        font-size: 1.4rem;
    }
    .mp-preview {
        padding: 1.1rem 1rem;
    }
}