/**
 * 侧边栏小工具样式
 * 
 * Hurricane v3.0
 * 适配日/夜模式，统一样式
 */

/* ========================================
   通用小工具样式
   ======================================== */

.content-sidebar {
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

.content-sidebar .widget {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.content-sidebar .widget:last-child {
    margin-bottom: 0;
}

.content-sidebar .widget-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========================================
   热门阅读列表
   ======================================== */

.popular-list,
.sidebar-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-list li,
.sidebar-post-list li {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.popular-list li:last-child,
.sidebar-post-list li:last-child {
    margin-bottom: 0;
}

/* 排名数字 */
.popular-list li .rank-number,
.rank-badge {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    transition: all 0.3s ease;
}

/* Top 3排名（渐变背景） */
.popular-list li:nth-child(1) .rank-number,
.popular-list li:nth-child(2) .rank-number,
.popular-list li:nth-child(3) .rank-number {
    background: linear-gradient(135deg, #ff6b6b, #ff922b);
    color: #ffffff;
}

/* Top 1金色 */
.popular-list li:nth-child(1) .rank-number {
    background: linear-gradient(135deg, #ffd43b, #ff922b);
    color: #1a1a1a;
}

/* 普通排名 */
.popular-list li:nth-child(n+4) .rank-number {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
}

/* 文章标题链接 */
.popular-list li a,
.sidebar-post-list li a {
    flex: 1;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.popular-list li a:hover,
.sidebar-post-list li a:hover {
    color: var(--accent-primary);
}

/* ========================================
   分类导航小工具
   ======================================== */

.widget-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-categories li {
    margin-bottom: 10px;
}

.widget-categories li:last-child {
    margin-bottom: 0;
}

.widget-categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.widget-categories a:hover {
    background-color: var(--accent-primary);
    color: #ffffff;
    transform: translateX(4px);
}

.widget-categories .count {
    font-size: 12px;
    opacity: 0.7;
}

/* ========================================
   标签云小工具
   ======================================== */

.widget-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.widget-tag-cloud .tag-cloud-link {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.widget-tag-cloud .tag-cloud-link:hover {
    background-color: var(--accent-primary);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ========================================
   搜索小工具
   ======================================== */

.widget-search .search-form {
    position: relative;
}

.widget-search input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-size: 14px;
}

.widget-search input[type="search"]:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.widget-search button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background-color: var(--accent-primary);
    color: #ffffff;
    cursor: pointer;
}

/* ========================================
   广告小工具
   ======================================== */

.widget-ad {
    text-align: center;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px dashed var(--border-color);
}

.widget-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ========================================
   最新文章小工具
   ======================================== */

.widget-recent-posts ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-recent-posts li {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.widget-recent-posts li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.widget-recent-posts a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    display: block;
}

.widget-recent-posts a:hover {
    color: var(--accent-primary);
}

.widget-recent-posts .post-date {
    display: block;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ========================================
   响应式适配
   ======================================== */

@media (max-width: 991px) {
    .content-sidebar {
        position: static;
    }
}

@media (max-width: 767px) {
    .content-sidebar .widget {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .content-sidebar .widget-title {
        font-size: 16px;
    }
}

