
/* 自定义侧边栏样式 */
:root {
    --primary: #18c8ff;
    --primary-2: #2f7bff;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --cyan: #22d3ee;
    --orange: #f59e0b;
    --text-main: #ffffff;
    --text-sub: #b8c7df;
    --border-glow: rgba(34, 211, 238, 0.35);
    --bg-card: rgba(12, 28, 55, 0.88);
    --bg-section: rgba(8, 24, 46, 0.95);
}

.custom-sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-page .info-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 30px;
    align-items: flex-start;
}

.single-page .info-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 30px;
    align-items: flex-start;
}

.sidebar-section {
    background: linear-gradient(145deg, rgba(12, 28, 55, 0.95), rgba(8, 18, 36, 0.9));
    border: 1px solid rgba(34, 211, 238, 0.24);
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: inset 0 0 34px rgba(14, 165, 233, 0.08);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px 0;
    padding-bottom: 14px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}

.title-icon {
    font-size: 20px;
}

/* 分类列表 */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-item {
    position: relative;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.category-link:hover {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.2);
}

.category-item.active .category-link {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
    font-weight: 700;
}

/* 激活状态下的 hover 也保持激活样式 */
.category-item.active .category-link:hover {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.15);
}

.toggle-icon {
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.toggle-icon:hover {
    background: rgba(34, 211, 238, 0.15);
}

.toggle-icon:hover::before,
.toggle-icon:hover::after {
    background: var(--cyan);
}

.toggle-icon::before,
.toggle-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--text-sub);
    border-radius: 2px;
    transition: all 0.15s ease;
}

.toggle-icon::before {
    width: 2px;
    height: 12px;
}

.toggle-icon::after {
    width: 12px;
    height: 2px;
}

.category-item.expanded .toggle-icon::before {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* 子分类 */
.subcategory-list {
    list-style: none;
    margin: 8px 0 0 24px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.2s ease;
}

.subcategory-list.expanded {
    max-height: 500px;
    opacity: 1;
}

.subcategory-item {
    position: relative;
}

.subcategory-link {
    display: block;
    padding: 10px 16px;
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.subcategory-link:hover {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.06);
}

.subcategory-item.active .subcategory-link {
    color: var(--cyan) !important;
    background: rgba(34, 211, 238, 0.12) !important;
    position: relative;
    font-weight: 700;
}

.subcategory-item.active .subcategory-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 0 4px 4px 0;
}

/* 激活状态下的 hover 也保持激活样式 */
.subcategory-item.active .subcategory-link:hover {
    color: var(--cyan) !important;
    background: rgba(34, 211, 238, 0.15) !important;
}

/* 热门文章 */
.popular-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popular-post-item {
    position: relative;
}

.popular-post-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(5, 16, 36, 0.6);
    border: 1px solid transparent;
}

.popular-post-link:hover {
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.25);
}

.post-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    font-weight: 900;
    font-size: 14px;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    flex-shrink: 0;
}

.post-number.highlight {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    box-shadow: 0 0 16px rgba(24, 200, 255, 0.3);
}

.post-title {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    flex: 1;
}

.popular-post-link:hover .post-title {
    color: var(--cyan);
}

/* 联系咨询 */
.contact-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(5, 16, 36, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(34, 211, 238, 0.18);
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(139, 92, 246, 0.15));
    border-radius: 10px;
    color: var(--cyan);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 24px;
    height: 24px;
}

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

.contact-label {
    color: var(--text-sub);
    font-size: 13px;
    font-weight: 500;
}

.contact-value {
    color: var(--cyan);
    font-size: 18px;
    font-weight: 900;
}

.contact-desc {
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 0 4px;
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none;
    border-radius: 999px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.contact-btn.primary {
    background: linear-gradient(90deg, var(--primary), var(--purple), var(--pink));
    color: white;
    box-shadow: 0 0 30px rgba(24, 200, 255, 0.3);
}

.contact-btn.primary:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 40px rgba(24, 200, 255, 0.4);
}

.qr-code-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 6px;
}

.qr-code-placeholder {
    width: 160px;
    height: 160px;
    background: rgba(5, 16, 36, 0.7);
    border: 2px dashed rgba(34, 211, 238, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-image {
    width: 160px;
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(34, 211, 238, 0.3);
}

.qr-icon {
    width: 80px;
    height: 80px;
    color: rgba(34, 211, 238, 0.4);
}

/* 响应式 */
@media (max-width: 1024px) {
    .category-page .info-layout,
    .single-page .info-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .custom-sidebar {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .sidebar-section {
        padding: 20px 16px;
    }
    
    .sidebar-title {
        font-size: 16px;
    }
    
    .qr-code-placeholder,
    .qr-code-image {
        width: 140px;
        height: 140px;
    }
}

