/**
 * component-sidebar.css - 侧边栏组件
 * 个人简介、标签云、热门文章、最近评论、一言
 */

/* ==============================
   侧边栏布局
   ============================== */
.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
}

.widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: var(--gap);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.widget-profile {
    padding: 0 !important;
    overflow: visible !important;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 8px 0 12px;
    padding: 0 0 0 12px;
    position: relative;
    line-height: 1.5;
}

.widget-title::before {
    content: '';
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 0;
    width: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* ==============================
   个人简介卡片
   ============================== */
.profile-card {
    position: relative;
    display: flex;
    flex-direction: column;
    text-align: center;
    min-height: 340px;
}

.profile-card-bg {
    width: 100%;
    flex: 0 0 50%;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.profile-card-bg .hero-video {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.profile-avatar img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    border: 3px solid #fff;
    box-shadow: var(--shadow-md);
}

.profile-card-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
}

.profile-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.profile-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 20px;
    padding: 0 20px;
}

.profile-stats {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 16px;
}

.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
}

.profile-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.profile-stat-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

/* ==============================
   分类列表（侧栏）
   ============================== */
.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.category-list li:last-child a {
    border-bottom: none;
}

.category-list li a:hover {
    color: var(--accent-primary);
}

.cat-count {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cat-name {
    flex: 1;
}

/* ==============================
   热门文章
   ============================== */
.hot-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.hot-list li:last-child a {
    border-bottom: none;
}

.hot-list li a:hover {
    color: var(--accent-primary);
}

.hot-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-views {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 12px;
}

/* ==============================
   标签云
   ============================== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: opacity 0.2s ease;
    text-decoration: none;
    line-height: 1.8;
}

.tag-item:hover {
    opacity: 0.75;
}

/* ==============================
   最近评论
   ============================== */
.recent-comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-comment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: opacity 0.2s ease;
}

.recent-comments-list li:last-child .recent-comment-item {
    border-bottom: none;
}

.recent-comment-item:hover {
    opacity: 0.75;
}

.recent-comment-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.recent-comment-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.recent-comment-author {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.recent-comment-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==============================
   一言
   ============================== */
.widget-motto {
    text-align: center;
}

.motto-content {
    padding: 3px 3px;
}

.motto-en {
    font-size: 0.75rem;
    color: var(--text-primary);
    font-style: italic;
    line-height: 1.5;
    margin: 0 0 4px;
}

.motto-cn {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ==============================
   人生倒计时
   ============================== */
.widget-timelife {
    text-align: center;
    padding: 16px 12px !important;
}

.timelife-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.timelife-item {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 10px 6px;
    text-align: center;
}

.timelife-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.timelife-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.timelife-progress {
    margin-top: 12px;
}

.timelife-bar-wrapper {
    margin-bottom: 8px;
}

.timelife-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.timelife-bar-track {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.timelife-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 1s ease;
}

/* ==============================
   那年今日
   ============================== */
.widget-history .history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-history .history-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-history .history-list li:last-child {
    border-bottom: none;
}

.history-year {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.history-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-decoration: none;
    transition: color 0.2s;
}

.history-title:hover {
    color: var(--accent-primary);
}

.history-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

/* ==============================
   热门文章（带排名）
   ============================== */
.hot-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.hot-list li:last-child a {
    border-bottom: none;
}

.hot-list li a:hover {
    color: var(--accent-primary);
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-muted);
    flex-shrink: 0;
}

.hot-rank-top {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
}

.hot-views {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: auto;
}
