/* 标签页面容器 */
.tags-container {
    --tags-easing: cubic-bezier(0.23, 1, 0.32, 1);
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 4rem 0.1rem;
    min-height: 60vh;
}

/* 页面标题区域和统计信息容器 */
.tags-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 5rem;
    gap: 3rem;
}

/* 页面标题区域 - 参考 services 页面风格 */
.tags-header {
    position: relative;
    flex: 1;
}

.tags-title-wrapper {
    position: relative;
    padding-top: 3rem;
    margin-bottom: 1.5rem;
}

.tags-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(5rem, 13vw, 11rem);
    line-height: 0.8;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 2px var(--glass-border);
    position: absolute;
    top: -2.5rem;
    left: -1rem;
    z-index: 0;
    transform: translateY(0);
    opacity: 1;
    pointer-events: none;
    white-space: nowrap;
}

.tags-subtitle-bg {
    position: relative;
    font-family: sans-serif;
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    z-index: 2;
    padding-left: 0.5rem;
    opacity: 1;
    letter-spacing: -0.02em;
    mix-blend-mode: normal;
    text-shadow: 20px 20px 40px var(--bg-color);
}

.tags-header-meta {
    display: flex;
    justify-content: flex-start;
    margin-top: 2rem;
    padding-left: 0.5rem;
    opacity: 1;
}

.tags-header p {
    font-family: sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 480px;
    line-height: 1.6;
    text-align: left;
}

/* 标签统计信息 */
.tags-stats {
    display: flex;
    gap: 3rem;
    padding: 0.5rem 0;
    position: relative;
}

.tags-stats::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 1px;
    background: var(--accent-subtle);
}

.tags-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    position: relative;
}

.tags-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.tags-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

/* 标签云区域 */
.tags-cloud-section {
    margin-bottom: 5rem;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
}

/* 标签芯片 */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--accent-subtle);
    border-radius: 24px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s var(--tags-easing);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.tag-chip-icon {
    opacity: 0.5;
    flex-shrink: 0;
    transition: all 0.3s var(--tags-easing);
    position: relative;
    z-index: 1;
}

.tag-chip:hover .tag-chip-icon {
    opacity: 1;
    color: var(--accent-color);
}

.tag-chip-text {
    position: relative;
    z-index: 1;
}

.tag-chip-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    padding: 0;
    min-width: 1.5em;
    text-align: center;
    transition: all 0.3s var(--tags-easing);
    position: relative;
    z-index: 1;
}

.tag-chip:hover .tag-chip-count {
    color: var(--text-secondary);
}

/* 标签分组区块 */
.tags-sections {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.tag-section {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--accent-subtle);
}

.tag-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tag-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--accent-subtle);
}

.tag-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.tag-section-title svg {
    opacity: 0.7;
    color: var(--accent-color);
}

.tag-section-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--tile-bg-2);
    border-radius: 20px;
    font-weight: 500;
}

/* 标签文章列表 */
.tag-posts-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tag-post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px 20px;
    margin: 0 -20px;
    border-bottom: 1px solid var(--accent-subtle);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.tag-post-item:first-child {
    border-top: 1px solid var(--accent-subtle);
}

.tag-post-item:hover {
    background-color: var(--hover-bg);
}

.tag-post-title {
    font-size: 1.1rem;
    font-weight: 500;
}

.tag-post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tags-cloud .tag-chip {
    animation: fadeInUp 0.5s var(--tags-easing) backwards;
}

/* 为每个标签芯片添加延迟动画 */
.tags-cloud .tag-chip:nth-child(1) { animation-delay: 0.05s; }
.tags-cloud .tag-chip:nth-child(2) { animation-delay: 0.1s; }
.tags-cloud .tag-chip:nth-child(3) { animation-delay: 0.15s; }
.tags-cloud .tag-chip:nth-child(4) { animation-delay: 0.2s; }
.tags-cloud .tag-chip:nth-child(5) { animation-delay: 0.25s; }
.tags-cloud .tag-chip:nth-child(6) { animation-delay: 0.3s; }
.tags-cloud .tag-chip:nth-child(7) { animation-delay: 0.35s; }
.tags-cloud .tag-chip:nth-child(8) { animation-delay: 0.4s; }
.tags-cloud .tag-chip:nth-child(9) { animation-delay: 0.45s; }
.tags-cloud .tag-chip:nth-child(10) { animation-delay: 0.5s; }
.tags-cloud .tag-chip:nth-child(11) { animation-delay: 0.55s; }
.tags-cloud .tag-chip:nth-child(12) { animation-delay: 0.6s; }
.tags-cloud .tag-chip:nth-child(13) { animation-delay: 0.65s; }
.tags-cloud .tag-chip:nth-child(14) { animation-delay: 0.7s; }
.tags-cloud .tag-chip:nth-child(15) { animation-delay: 0.75s; }
.tags-cloud .tag-chip:nth-child(16) { animation-delay: 0.8s; }
.tags-cloud .tag-chip:nth-child(17) { animation-delay: 0.85s; }
.tags-cloud .tag-chip:nth-child(18) { animation-delay: 0.9s; }
.tags-cloud .tag-chip:nth-child(19) { animation-delay: 0.95s; }
.tags-cloud .tag-chip:nth-child(20) { animation-delay: 1s; }

/* Light 主题调整 */
[data-theme="light"] .tag-chip {
    background: transparent;
    border-color: var(--accent-subtle);
}

[data-theme="light"] .tag-chip:hover {
    border-color: var(--accent-color);
}

[data-theme="light"] .tag-chip-count {
    background: transparent;
    color: var(--text-secondary);
}

[data-theme="light"] .tag-chip:hover .tag-chip-count {
    color: var(--text-secondary);
}

[data-theme="light"] .tags-stat-value {
    color: var(--text-primary);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .tags-container {
        padding: 2rem 1rem 1rem;
    }

    .tags-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }

    .tags-header {
        padding-top: 1rem;
    }

    .tags-title-wrapper {
        padding-top: 1.5rem;
    }

    .tags-header h1 {
        font-size: clamp(3rem, 12vw, 5rem);
        top: -1rem;
        left: -0.5rem;
        -webkit-text-stroke: 1px var(--glass-border);
    }

    .tags-subtitle-bg {
        font-size: clamp(1.5rem, 5vw, 2rem);
        padding-left: 0;
    }

    .tags-header-meta {
        justify-content: flex-start;
        text-align: left;
        margin-top: 1.5rem;
        padding-left: 0;
    }

    .tags-stats {
        gap: 2rem;
        padding: 0;
    }

    .tags-stats::before {
        display: none;
    }

    .tags-stat-value {
        font-size: 1.75rem;
    }

    .tags-header p {
        text-align: left;
        max-width: 100%;
        font-size: 0.95rem;
    }

    .tags-cloud-section {
        margin-bottom: 3rem;
    }

    .tags-cloud {
        gap: 10px;
        padding: 0;
    }

    .tag-chip {
        padding: 8px 14px;
        font-size: 0.9rem;
        border-radius: 20px;
    }

    .tag-chip-count {
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    .tag-section-title {
        font-size: 1.25rem;
    }

    .tag-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 12px;
    }

    .tag-post-item {
        padding: 14px 16px;
        flex-direction: column;
        gap: 6px;
        align-items: flex-start;
    }

    .tag-post-title {
        font-size: 1rem;
    }

    .tag-post-date {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .tags-container {
        padding: 1.5rem 0.75rem 0.5rem;
    }

    .tags-header h1 {
        font-size: 2.5rem;
    }

    .tags-subtitle-bg {
        font-size: 1.3rem;
    }

    .tags-cloud {
        padding: 1rem;
        gap: 8px;
    }

    .tag-chip {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .tag-section-title {
        font-size: 1.15rem;
    }
}
