﻿/* 側邊欄組件樣式 */

/* 側邊欄基本樣式 */
.sidebar-section {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #1a4b8c;
    position: relative;
    padding-bottom: 10px;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: #ff9d2f;
}

/* 搜索框 */
.search-form {
    display: flex;
    margin-bottom: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px 0 0 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary)333;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    background-color: var(--bg-secondary);
    border-color: #1a4b8c;
}

.search-button {
    padding: 10px 15px;
    border: none;
    border-radius: 0 20px 20px 0;
    background-color: #1a4b8c;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background-color: #3a7bd5;
}

/* 分類列表 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.category-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary)333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-link:hover {
    color: #1a4b8c;
}

.category-count {
    background-color: var(--bg-secondary);
    color: var(--text-muted)666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.category-link:hover .category-count {
    background-color: #1a4b8c;
    color: #ffffff;
}

/* 熱門文章 */
.popular-articles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-article {
    display: flex;
    gap: 10px;
}

.popular-article-image {
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 5px;
    flex-shrink: 0;
    position: relative;
}

.popular-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.popular-article-content {
    flex: 1;
    min-width: 0;
}

.popular-article-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-article-title a {
    color: var(--text-primary)333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-article-title a:hover {
    color: #1a4b8c;
}

.popular-article-meta {
    font-size: 12px;
    color: var(--text-muted)666;
}

/* 標籤雲 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--bg-secondary);
    color: var(--text-muted)666;
    text-decoration: none;
    border-radius: 15px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #1a4b8c;
    color: #ffffff;
}

/* 廣告區塊 */
.sidebar-ad {
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-ad img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
}

.sidebar-ad:hover img {
    transform: scale(1.02);
}

/* 訂閱區塊 */
.subscribe-form {
    margin-top: 15px;
}

.subscribe-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary)333;
    font-size: 14px;
    margin-bottom: 10px;
}

.subscribe-input:focus {
    outline: none;
    background-color: var(--bg-secondary);
    border-color: #1a4b8c;
}

.subscribe-button {
    width: 100%;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: #1a4b8c;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.subscribe-button:hover {
    background-color: #3a7bd5;
    transform: translateY(-2px);
}

/* 响应式调整 */
@media (max-width: 992px) {
    .popular-article-image {
        width: 70px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    .sidebar-section {
        padding: 15px;
    }
    
    .tag-cloud {
        gap: 8px;
    }
    
    .tag {
        padding: 4px 8px;
        font-size: 11px;
    }
}
