/* 插件和节点详情页面 - 左侧菜单样式 */

/* 页面布局 - 三列Grid */
.plugin-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.plugin-detail-left-sidebar,
.plugin-detail-right-sidebar {
    min-width: 0;
}

.plugin-detail-main-content {
    min-width: 0; /* 防止内容溢出 */
}

/* 侧边栏容器 */
.plugin-detail-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.sidebar-card-title {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
}

/* 侧边栏菜单 */
.sidebar-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 分组容器 */
.sidebar-nav-group {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-nav-group:last-child {
    border-bottom: none;
}

/* 分组标题 */
.sidebar-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    color: var(--dark-text);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-group-title:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.sidebar-group-title span {
    flex: 1;
}

.group-toggle {
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.sidebar-group-title:hover .group-toggle {
    color: var(--primary-color);
}

.sidebar-nav-group.collapsed .group-toggle {
    transform: rotate(-90deg);
}

/* 分组项目列表 */
.sidebar-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav-group.collapsed .sidebar-group-items {
    max-height: 0;
}

.sidebar-group-items .sidebar-nav-item {
    border-bottom: 1px solid #f8fafc;
}

.sidebar-group-items .sidebar-nav-item:last-child {
    border-bottom: none;
}

.sidebar-group-items .sidebar-nav-link {
    padding-left: 2.75rem;
    background: white;
    position: relative;
}

.sidebar-group-items .sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
}

.sidebar-group-items .sidebar-nav-item.active .sidebar-nav-link::before {
    background: var(--primary-color);
}

.sidebar-group-items .sidebar-nav-link i {
    display: none;
}

/* 单独的导航项（不在分组中） */
.sidebar-nav-item {
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-nav-item:last-child {
    border-bottom: none;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    color: var(--light-text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav-link:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-nav-item.active .sidebar-nav-link {
    background-color: #f0f9ff;
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-nav-item.active .sidebar-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-color);
}

.sidebar-nav-link i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
}

.sidebar-nav-link span {
    flex: 1;
}

.sidebar-node-count {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 节点元信息 */
.detail-node-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #64748b;
}

.detail-plugin-tag {
    font-size: 1rem;
    font-weight: 700;
    color: #64748b;
}

.detail-time {
    font-size: 0.875rem;
    color: #64748b;
}

/* 节点/插件标题 */
.detail-page-title {
    display: inline-block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--dark-text);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

/* 功能说明盒子 */
.detail-function-box {
    margin-top: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
    border-left: 4px solid #626aef;
    background: #f1f5f9;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.6;
}

.detail-content-wrapper {
    margin-top: 2rem;
}

/* 内容区域 */
.detail-content-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

/* 参数表格样式 */
.detail-params-section {
    margin: 1.5rem 0;
}

.detail-params-title {
    display: flex;
    margin: 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.05em;
}

.detail-param-table-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.detail-params-table {
    min-width: 100%;
    font-size: 0.875rem;
    table-layout: fixed;
    border-collapse: collapse;
}

.detail-params-table tbody {
    background: white;
}

.detail-params-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.detail-params-table tbody tr:last-child {
    border-bottom: none;
}

.detail-param-category-header {
    background: #f1f5f9 !important;
}

.detail-param-category-header td {
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
}

.detail-param-name {
    padding: 1rem 1.5rem;
    width: 30%;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    vertical-align: top;
}

.detail-param-desc {
    padding: 1rem 1.5rem;
    width: 70%;
    color: #64748b;
    vertical-align: top;
    line-height: 1.5;
}

.detail-params-table tbody tr:hover {
    background: #f8fafc;
}

/* 上一篇/下一篇导航 */
.detail-article-footer {
    margin: 1.5rem 0;
    margin-bottom: 3rem;
}

.detail-article-nav-links {
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.detail-nav-prev,
.detail-nav-next {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: color 0.3s ease;
}

.detail-nav-prev:hover,
.detail-nav-next:hover {
    color: #0f172a;
    text-decoration: none;
}

.detail-nav-icon-left,
.detail-nav-icon-right {
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.detail-nav-icon-left {
    margin-right: 0.5rem;
}

.detail-nav-icon-right {
    margin-left: 0.5rem;
}

.detail-nav-prev:hover .detail-nav-icon-left,
.detail-nav-next:hover .detail-nav-icon-right {
    color: #475569;
}

/* 文章导航 */
.detail-article-nav {
    position: sticky;
    top: 2rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.detail-nav-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.detail-nav-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark-text);
}

.detail-nav-content {
    padding: 1rem 0;
}

.detail-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.detail-nav-list-item {
    border-bottom: 1px solid #f1f5f9;
}

.detail-nav-list-item:last-child {
    border-bottom: none;
}

.detail-toc-link {
    display: block;
    padding: 0.5rem 1.5rem;
    color: var(--light-text);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    line-height: 1.4;
}

.detail-toc-link:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
    text-decoration: none;
}

.detail-toc-link.active {
    background-color: #f0f9ff;
    color: var(--primary-color);
    font-weight: 600;
    border-left: 3px solid var(--primary-color);
}

/* 标题层级 */
.detail-nav-list-item.h1 .detail-toc-link {
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-nav-list-item.h2 .detail-toc-link {
    padding-left: 2rem;
    font-size: 0.9rem;
}

.detail-nav-list-item.h3 .detail-toc-link {
    padding-left: 2.5rem;
    font-size: 0.85rem;
}

.detail-nav-list-item.h4 .detail-toc-link {
    padding-left: 3rem;
    font-size: 0.8rem;
}

/* 响应式调整 */

/* 大平板设备 (≤1200px) */
@media (max-width: 1200px) {
    .plugin-detail-layout {
        grid-template-columns: 240px 1fr 280px;
        gap: 1.5rem;
    }
}

/* 平板设备 (≤991px) - 隐藏右侧栏 */
@media (max-width: 991.98px) {
    .plugin-detail-layout {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
    
    .plugin-detail-right-sidebar {
        display: none; /* 隐藏文章导航 */
    }
    
    .plugin-detail-sidebar,
    .detail-article-nav {
        position: static;
        margin-bottom: 2rem;
    }
    
    /* 侧边栏在上方时，宽度调整 */
    .sidebar-card,
    .detail-article-nav {
        max-width: 100%;
    }
    
    .detail-page-title {
        font-size: 1.75rem;
    }
}

/* 小屏幕平板 (≤768px) - 单列布局 */
@media (max-width: 768px) {
    .plugin-detail-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* 隐藏左侧菜单 */
    .plugin-detail-left-sidebar {
        display: none !important;
    }
    
    /* 隐藏右侧文章导航 */
    .plugin-detail-right-sidebar {
        display: none !important;
    }
    
    .plugin-detail-sidebar,
    .detail-article-nav {
        position: static;
    }
    
    .detail-node-meta {
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .detail-page-title {
        font-size: 1.5rem;
        line-height: 1.2;
    }
    
    .detail-content-section {
        padding: 1.5rem;
    }
    
    .detail-function-box {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    /* 参数表格优化 */
    .detail-param-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .detail-params-table {
        font-size: 0.8rem;
    }
    
    .detail-param-name,
    .detail-param-desc {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .detail-param-category-header td {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
    
    /* 导航链接优化 */
    .detail-article-nav-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .detail-nav-prev,
    .detail-nav-next {
        font-size: 0.8rem;
        justify-content: center;
        text-align: center;
    }
    
    /* 侧边栏导航菜单 */
    .sidebar-nav-link {
        padding: 0.375rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* 文章导航 */
    .detail-toc-link {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }
}

/* 手机设备 (≤576px) */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .plugin-detail-layout {
        gap: 1rem;
    }
    
    .detail-content-section {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .detail-page-title {
        font-size: 1.25rem;
    }
    
    .detail-plugin-tag,
    .detail-time {
        font-size: 0.75rem;
    }
    
    .detail-function-box {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    /* 参数表格移动端优化 */
    .detail-param-name {
        width: 35%;
        font-size: 0.75rem;
    }
    
    .detail-param-desc {
        width: 65%;
        font-size: 0.75rem;
    }
    
    .detail-params-title {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    /* 侧边栏卡片 */
    .sidebar-card {
        margin-bottom: 1rem;
    }
    
    .sidebar-card-title {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .sidebar-nav-link {
        padding: 0.25rem 1rem;
        font-size: 0.85rem;
    }
    
    /* 导航链接 */
    .detail-nav-prev,
    .detail-nav-next {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .detail-nav-icon-left,
    .detail-nav-icon-right {
        width: 0.875rem;
        height: 0.875rem;
    }
    
    /* 文章导航 */
    .detail-article-nav {
        margin-top: 1.5rem;
    }
    
    .detail-nav-header h5 {
        font-size: 0.9rem;
    }
    
    .detail-nav-list-item.h2 .detail-toc-link {
        padding-left: 1.25rem;
    }
    
    .detail-nav-list-item.h3 .detail-toc-link {
        padding-left: 1.75rem;
    }
    
    .detail-nav-list-item.h4 .detail-toc-link {
        padding-left: 2.25rem;
    }
}

