/**
 * 首页右侧栏内链优化样式
 * Homepage Sidebar Internal Links Styles
 * 版本: v1.0
 * 创建日期: 2025-10-14
 */

/* ==========================================
   内链Widget通用样式
   ========================================== */
.internal-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 400px;
    overflow-y: auto;
}

/* 自定义滚动条 */
.internal-links-list::-webkit-scrollbar {
    width: 6px;
}

.internal-links-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.internal-links-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.internal-links-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* 列表项样式 */
.internal-links-list li {
    border-bottom: 1px dashed #e5e7eb;
    padding: 8px 0;
}

.internal-links-list li:last-child {
    border-bottom: none;
}

.internal-links-list li a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.internal-links-list li a:hover {
    color: #6366f1;
}

/* 文章元素 */
.article-icon {
    flex-shrink: 0;
    font-size: 14px;
    margin-top: 2px;
}

.article-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.article-date {
    flex-shrink: 0;
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ==========================================
   Tab切换样式
   ========================================== */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.category-tabs .tab {
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.category-tabs .tab:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.category-tabs .tab.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

/* ==========================================
   折叠面板样式
   ========================================== */
.archive-accordion {
    max-height: 500px;
    overflow-y: auto;
}

.archive-accordion::-webkit-scrollbar {
    width: 6px;
}

.archive-accordion::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.accordion-item {
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.accordion-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f9fafb;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: background 0.2s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #f3f4f6;
}

.accordion-icon {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(90deg);
}

.accordion-content {
    padding: 0 12px 12px 12px;
    background: white;
}

.accordion-content .widget-list {
    max-height: 200px;
}

.view-all-link {
    display: block;
    text-align: center;
    padding: 8px;
    margin-top: 8px;
    color: #6366f1;
    font-size: 12px;
    text-decoration: none;
    border-top: 1px dashed #e5e7eb;
    transition: color 0.2s ease;
}

.view-all-link:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* ==========================================
   刷新按钮
   ========================================== */
.widget-refresh {
    display: block;
    text-align: center;
    padding: 8px;
    margin-top: 12px;
    color: #6366f1;
    font-size: 12px;
    text-decoration: none;
    border: 1px dashed #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    user-select: none;
}

.widget-refresh:hover {
    background: #f9fafb;
    border-color: #6366f1;
    text-decoration: none;
}

.widget-refresh:active {
    transform: scale(0.98);
}

/* ==========================================
   加载状态
   ========================================== */
.loading-skeleton {
    padding: 8px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.skeleton-line {
    height: 12px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #f8f8f8 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 6px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==========================================
   错误提示
   ========================================== */
.widget-error {
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    color: #991b1b;
    font-size: 12px;
    text-align: center;
}

.widget-empty {
    padding: 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* ==========================================
   Widget标题增强
   ========================================== */
.widget-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================
   响应式设计
   ========================================== */
@media (max-width: 1023px) {
    .internal-links-list {
        max-height: 300px;
    }

    .archive-accordion {
        max-height: 400px;
    }
}

@media (max-width: 767px) {
    .category-tabs {
        justify-content: center;
    }

    .internal-links-list {
        max-height: 250px;
    }

    .article-date {
        display: none;
    }
}
