/**
 * Sidebar Styles
 * Beautifies the related news and recommended section in the right sidebar.
 */

/* Container styling */
.paned-sd {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    overflow: hidden;
}

/* Title Tab styling */
.paned-sd-tits {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    display: flex;
}

.paned-sd-tits .tab-tit {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.paned-sd-tits .tab-tit:hover {
    color: #3b82f6;
    background: #f1f5f9;
}

.paned-sd-tits .tab-tit.active {
    color: #3b82f6;
    background: #fff;
    border-bottom-color: #3b82f6;
}

/* Single title styling (for non-tab blocks) */
.paned-sd-tits:not(.clearfix) {
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #f8fafc;
}

/* Content list styling */
.news-con {
    padding: 10px 0;
}

.news-con ul {
    padding: 0;
    margin: 0;
    list-style: none;
    counter-reset: sidebar-counter; /* 初始化计数器 */
}

.news-con li {
    padding: 0;
    border-bottom: 1px dashed #f0f0f0;
    transition: background-color 0.2s;
    position: relative; /* 为定位序号做准备 */
}

/* 序号样式 */
.news-con li::before {
    counter-increment: sidebar-counter; /* 计数器递增 */
    content: counter(sidebar-counter); /* 显示计数器 */
    position: absolute;
    left: 15px;
    top: 15px; /* 根据实际 padding 调整 */
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    background-color: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
}

/* 前三名高亮样式 */
.news-con li:nth-child(1)::before {
    background-color: #ef4444; /* 红色 */
    color: #fff;
}

.news-con li:nth-child(2)::before {
    background-color: #f97316; /* 橙色 */
    color: #fff;
}

.news-con li:nth-child(3)::before {
    background-color: #f59e0b; /* 黄色 */
    color: #fff;
}

.news-con li a {
    display: block;
    padding: 12px 20px 12px 45px; /* 左侧增加内边距给序号留位置 */
    text-decoration: none;
}

/* Text styling */
.news-con .text h2 {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
    font-weight: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s;
}

.news-con li:hover .text h2 {
    color: #3b82f6;
}

.news-con .text p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-con .text p i {
    font-size: 12px;
    color: #cbd5e1;
}

/* Hide images in sidebar as requested */
.news-con .img-center {
    display: none !important;
}

/* Ensure tab switching works (simple CSS-based for now, JS might be needed if not present) */
.tab-panel {
    display: none;
}
.tab-panel[style*="display:block"] {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
