/* =====================================================
   标签归档页面专用样式
   使用BEM命名规范，完全独立避免冲突
   主题色：电蓝色 #3E6AE1
   ===================================================== */

:root {
    --tag-archive-bg: var(--light-ash, #F4F4F4);
    --tag-archive-banner-bg: linear-gradient(135deg, #3E6AE1 0%, #2D5BC9 50%, #1E4AAF 100%);
    --tag-archive-text-light: var(--pure-white, #FFFFFF);
    --tag-archive-card-bg: var(--pure-white, #FFFFFF);
    --tag-archive-border: var(--border-light, #EEEEEE);
    --tag-archive-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --tag-archive-radius: 12px;
    --tag-archive-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --tag-archive-primary: var(--electric-blue, #3E6AE1);
    --tag-archive-primary-hover: var(--electric-blue-hover, #3357c2);
    --tag-archive-text-dark: var(--text-primary, #171A20);
    --tag-archive-text-body: var(--text-body, #393C41);
    --tag-archive-text-muted: var(--text-tertiary, #5C5E62);
    --tag-archive-light-bg: var(--light-ash, #F4F4F4);
}

.tag-archive {
    background-color: var(--tag-archive-bg);
    min-height: 100vh;
}

/* =====================================================
   Banner区域 - 靠左对齐，使用主题电蓝色
   ===================================================== */

.tag-archive__banner {
    background: var(--tag-archive-banner-bg);
    padding: 60px 20px;
    color: var(--tag-archive-text-light);
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    text-align: left;
}

/* 动态背景装饰 */
.tag-archive__banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    animation: tagArchiveFloat 12s ease-in-out infinite;
    pointer-events: none;
}

.tag-archive__banner::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: tagArchiveFloat 15s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes tagArchiveFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Banner内容容器 - 靠左对齐 */
.tag-archive__banner-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 标题样式 */
.tag-archive__title {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 15px;
    color: var(--tag-archive-text-light);
    text-shadow: 0 2px 10px rgba(0,0,0,0.15);
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.tag-archive__title i {
    margin-right: 12px;
    animation: tagIconBounce 2s ease-in-out infinite;
}

@keyframes tagIconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 元信息区域 */
.tag-archive__meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
    font-size: 15px;
}

.tag-archive__count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 1px solid rgba(255,255,255,0.3);
    font-weight: 600;
}

/* 面包屑导航 */
.tag-archive__breadcrumb {
    font-size: 14px;
    opacity: 0.95;
}

.tag-archive__breadcrumb a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255,255,255,0.5);
    transition: border-color 0.3s;
}

.tag-archive__breadcrumb a:hover {
    border-bottom-style: solid;
}

/* =====================================================
   主布局区
   ===================================================== */

.tag-archive__layout {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.tag-archive__content {
    flex: 1 1 70%;
    min-width: 0;
    background: var(--tag-archive-card-bg);
    border-radius: var(--tag-archive-radius);
    box-shadow: var(--tag-archive-shadow);
    padding: 25px;
    border: 1px solid rgba(0,0,0,0.05);
}

.tag-archive__sidebar-wrapper {
    flex: 0 0 320px;
    min-width: 320px;
}

.tag-archive__sidebar {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    height: fit-content;
}

/* =====================================================
   文章列表样式
   ===================================================== */

.tag-archive__post-item {
    background: var(--tag-archive-card-bg);
    border-radius: var(--tag-archive-radius);
    box-shadow: var(--tag-archive-shadow);
    overflow: hidden;
    margin-bottom: 25px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0,0,0,0.05);
}

.tag-archive__post-item:last-child {
    margin-bottom: 0;
}

.tag-archive__post-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: rgba(62,106,225,0.2);
}

/* 相关推荐文章特殊样式 */
.tag-archive__post-item--related {
    border-left: 4px solid var(--tag-archive-primary);
    background: linear-gradient(to right, #f8fbff 0%, var(--tag-archive-card-bg) 100%);
}

.tag-archive__post-link {
    display: flex;
    text-decoration: none;
    color: inherit;
    background: transparent;
}

/* 缩略图 */
.tag-archive__post-thumbnail {
    flex: 0 0 280px;
    width: 280px;
    min-height: 200px;
    height: auto;
    align-self: stretch;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #e8ecf1 0%, #d1d8e3 100%);
}

.tag-archive__post-thumbnail img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    left: 0;
}

.tag-archive__post-item:hover .tag-archive__post-thumbnail img {
    transform: scale(1.08);
}

.tag-archive__post-thumbnail::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to right, transparent 50%, rgba(0,0,0,0.03));
    pointer-events: none;
}

/* 文章主体内容 */
.tag-archive__post-body {
    flex: 1;
    padding: 28px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

/* 相关推荐标签 */
.tag-archive__related-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: linear-gradient(135deg, var(--tag-archive-primary), #2D5BC9);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
    width: fit-content;
}

/* 文章标题 */
.tag-archive__post-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--tag-archive-text-dark);
    transition: color 0.3s;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tag-archive__post-item:hover .tag-archive__post-title {
    color: var(--tag-archive-primary);
}

/* 文章摘要 */
.tag-archive__post-excerpt {
    font-size: 15px;
    color: var(--tag-archive-text-body);
    line-height: 1.7;
    margin-bottom: 18px;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 文章元信息 */
.tag-archive__post-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 13px;
    color: var(--tag-archive-text-muted);
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--tag-archive-border);
}

.tag-archive__post-date,
.tag-archive__post-category,
.tag-archive__post-tag-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tag-archive__post-meta i {
    font-size: 13px;
    color: var(--tag-archive-primary);
}

/* 展开按钮 */
.tag-archive__post-more {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    color: var(--tag-archive-primary);
    font-size: 24px;
    transition: all 0.3s;
    background: var(--tag-archive-light-bg);
    border-left: 1px solid var(--tag-archive-border);
}

.tag-archive__post-item:hover .tag-archive__post-more {
    background: var(--tag-archive-primary);
    color: white;
    transform: translateX(5px);
}

/* =====================================================
   相关推荐区域
   ===================================================== */

.tag-archive__related-section {
    margin-top: 45px;
    padding-top: 35px;
    border-top: 2px solid var(--tag-archive-border);
    position: relative;
}

.tag-archive__related-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--tag-archive-primary), transparent);
    border-radius: 2px;
}

.tag-archive__related-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--tag-archive-text-dark);
    margin: 0 0 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-archive__related-title i {
    color: var(--tag-archive-primary);
    font-size: 24px;
}

.tag-archive__related-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* =====================================================
   侧边栏样式
   ===================================================== */

.tag-archive__sidebar-section {
    background: var(--tag-archive-card-bg);
    border-radius: var(--tag-archive-radius);
    box-shadow: var(--tag-archive-shadow);
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.tag-archive__sidebar-section:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.tag-archive__sidebar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--tag-archive-text-dark);
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--tag-archive-border);
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-archive__sidebar-title i {
    color: var(--tag-archive-primary);
    font-size: 18px;
}

.tag-archive__sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--tag-archive-primary), transparent);
    border-radius: 2px;
}

/* 标签云 */
.tag-archive__tags-cloud {
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    line-height: 1.8;
}

.tag-archive__tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecf5 100%);
    color: var(--tag-archive-primary);
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(62,106,225,0.15);
    position: relative;
    overflow: hidden;
}

.tag-archive__tag-chip::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.tag-archive__tag-chip:hover {
    background: linear-gradient(135deg, var(--tag-archive-primary) 0%, #2D5BC9 100%);
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(62,106,225,0.35);
    border-color: transparent;
}

.tag-archive__tag-chip:hover::before {
    left: 100%;
}

/* 标签计数徽章 */
.tag-archive__tag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 4px;
    background: rgba(62,106,225,0.12);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--tag-archive-primary);
    transition: all 0.3s;
}

.tag-archive__tag-chip:hover .tag-archive__tag-badge {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* 推荐标签权重颜色 */
.tag-archive__tag-chip--high {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    color: #c53030;
    border-color: rgba(197,48,48,0.2);
}

.tag-archive__tag-chip--high:hover {
    background: linear-gradient(135deg, #c53030 0%, #9b2c2c 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(197,48,48,0.35);
}

.tag-archive__tag-chip--medium {
    background: linear-gradient(135deg, #fffff0 0%, #fefcbf 100%);
    color: #b7791f;
    border-color: rgba(183,121,31,0.2);
}

.tag-archive__tag-chip--medium:hover {
    background: linear-gradient(135deg, #b7791f 0%, #975a16 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(183,121,31,0.35);
}

.tag-archive__tag-chip--low {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    color: #276749;
    border-color: rgba(39,103,73,0.2);
}

.tag-archive__tag-chip--low:hover {
    background: linear-gradient(135deg, #276749 0%, #22543d 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(39,103,73,0.35);
}

/* =====================================================
   空状态样式
   ===================================================== */

.tag-archive__empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--tag-archive-card-bg);
    border-radius: var(--tag-archive-radius);
    box-shadow: var(--tag-archive-shadow);
}

.tag-archive__empty-icon {
    font-size: 64px;
    color: var(--tag-archive-text-muted);
    margin-bottom: 20px;
    opacity: 0.6;
}

.tag-archive__empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--tag-archive-text-dark);
    margin: 0 0 10px;
}

.tag-archive__empty-description {
    font-size: 14px;
    color: var(--tag-archive-text-body);
    line-height: 1.6;
    margin: 0 0 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.tag-archive__empty-suggestions {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid var(--tag-archive-border);
}

.tag-archive__suggestions-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tag-archive-text-muted);
    margin: 0 0 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-archive__suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag-archive__suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f6f8fb 0%, #e9ecf5 100%);
    color: var(--tag-archive-primary);
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(62,106,225,0.15);
}

.tag-archive__suggestion-chip:hover {
    background: linear-gradient(135deg, var(--tag-archive-primary) 0%, #2D5BC9 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(62,106,225,0.35);
}

.tag-archive__empty-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--tag-archive-primary) 0%, #2D5BC9 100%);
    color: white;
    text-decoration: none;
    border-radius: 28px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(62,106,225,0.3);
}

.tag-archive__empty-home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(62,106,225,0.4);
}

/* =====================================================
   分页导航
   ===================================================== */

.tag-archive__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
    padding: 25px 0;
}

/* =====================================================
   响应式设计 - 移动端优化
   ===================================================== */

@media (max-width: 768px) {
    .tag-archive__banner {
        padding: 35px 15px;
    }

    .tag-archive__title {
        font-size: 26px !important;
    }

    .tag-archive__meta {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .tag-archive__count {
        font-size: 13px;
        padding: 6px 16px;
    }

    .tag-archive__layout {
        flex-direction: column;
        gap: 25px;
        padding: 0 15px;
        margin: 25px auto;
    }

    .tag-archive__content {
        flex: 1 1 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .tag-archive__sidebar {
        flex: 1 1 100%;
        width: 100%;
        min-width: 100%;
        box-sizing: border-box;
    }

    .tag-archive__post-link {
        flex-direction: column;
    }

    .tag-archive__post-thumbnail {
        flex: 0 0 auto;
        width: 100%;
        height: 220px;
        min-height: 220px;
    }

    .tag-archive__post-thumbnail img {
        position: absolute;
        top: 0;
        left: 0;
    }

    .tag-archive__post-thumbnail::after {
        background: linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.05));
    }

    .tag-archive__post-body {
        padding: 20px;
    }

    .tag-archive__post-title {
        font-size: 17px !important;
    }

    .tag-archive__post-excerpt {
        font-size: 14px;
        line-height: 1.6;
        -webkit-line-clamp: 2;
        margin-bottom: 15px;
    }

    .tag-archive__post-meta {
        gap: 12px;
        font-size: 12px;
        padding-top: 12px;
    }

    .tag-archive__post-more {
        display: none;
    }

    /* 移动端侧边栏折叠为手风琴 */
    .tag-archive__sidebar-section {
        margin-bottom: 18px;
        padding: 0;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    details.tag-archive__sidebar-section summary {
        cursor: pointer;
        list-style: none;
        padding: 18px;
        background: var(--tag-archive-card-bg);
        border-radius: var(--tag-archive-radius);
        box-shadow: var(--tag-archive-shadow);
        font-weight: 700;
        font-size: 15px;
        color: var(--tag-archive-text-dark);
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
        transition: all 0.3s;
        border: 1px solid rgba(0,0,0,0.05);
    }

    details.tag-archive__sidebar-section summary:hover {
        background-color: #f8f9fa;
        transform: translateX(3px);
    }

    details.tag-archive__sidebar-section summary::-webkit-details-marker {
        display: none;
    }

    details.tag-archive__sidebar-section summary::after {
        content: '+';
        font-size: 22px;
        font-weight: 300;
        transition: transform 0.3s ease;
        color: var(--tag-archive-primary);
    }

    details.tag-archive__sidebar-section[open] summary::after {
        transform: rotate(45deg);
    }

    details.tag-archive__sidebar-section[open] > *:not(summary) {
        padding: 18px;
        border-top: 1px solid var(--tag-archive-border);
        background: var(--tag-archive-card-bg);
        border-radius: 0 0 var(--tag-archive-radius) var(--tag-archive-radius);
        margin-top: -1px;
    }

    .tag-archive__sidebar-title {
        font-size: 15px;
        margin: 0;
        padding: 10px;
        border-bottom: none;
    }

    .tag-archive__sidebar-title::after {
        display: none;
    }

    .tag-archive__tag-chip {
        font-size: 12px;
        padding: 6px 14px;
    }

    .tag-archive__related-section {
        margin-top: 30px;
        padding-top: 25px;
    }

    .tag-archive__related-title {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .tag-archive__banner {
        padding: 25px 12px;
    }

    .tag-archive__title {
        font-size: 22px !important;
    }

    .tag-archive__banner-content {
        padding: 0 12px;
    }

    .tag-archive__layout {
        padding: 0;
        margin: 25px 0;
    }

    .tag-archive__content {
        padding: 16px;
        border-radius: 12px;
    }

    .tag-archive__post-body {
        padding: 16px;
    }

    .tag-archive__post-thumbnail {
        height: 180px;
        min-height: 180px;
    }
}
