/* 云图容器样式 */
.tag-cloud-container {
    position: relative;
    width: 100%;
    height: 600px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.tag-cloud {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

/* 基础标签样式 - 高性能版本 */
.tag-item {
    position: absolute;
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    border: 2px solid transparent;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    will-change: transform;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.5px;
    line-height: 1.2;
    transform-origin: center center;
}

/* 文字方向样式 */
.tag-item.horizontal {
    transform: rotate(0deg);
}

.tag-item.vertical {
    transform: rotate(90deg);
    writing-mode: vertical-rl;
}

.tag-item.diagonal-right {
    transform: rotate(15deg);
}

.tag-item.diagonal-left {
    transform: rotate(-15deg);
}

.tag-item.diagonal-steep-right {
    transform: rotate(45deg);
}

.tag-item.diagonal-steep-left {
    transform: rotate(-45deg);
}

/* 热度等级样式 - 动态大小，颜色由JavaScript控制 */
.tag-hot-1 { 
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 600;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-2 { 
    font-size: 0.9rem;
    opacity: 0.85;
    font-weight: 600;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-3 { 
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 600;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-4 { 
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 700;
    z-index: 4;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-5 { 
    font-size: 1.5rem;
    opacity: 1.0;
    font-weight: 700;
    z-index: 5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-6 { 
    font-size: 1.7rem;
    opacity: 1.0;
    font-weight: 700;
    z-index: 6;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-7 { 
    font-size: 1.9rem;
    opacity: 1.0;
    font-weight: 800;
    z-index: 7;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-8 { 
    font-size: 2.1rem;
    opacity: 1.0;
    font-weight: 800;
    z-index: 8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-9 { 
    font-size: 2.3rem;
    opacity: 1.0;
    font-weight: 800;
    z-index: 9;
    text-shadow: 0 2px 5px rgba(0,0,0,0.4);
    transform-origin: center center;
}
.tag-hot-10 { 
    font-size: 2.6rem;
    opacity: 1.0;
    font-weight: 900;
    z-index: 10;
    text-shadow: 0 3px 6px rgba(0,0,0,0.5);
    transform-origin: center center;
}

/* 悬停效果 - 完全固定位置，只放大 */
.tag-item:hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
    z-index: 100 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.2) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
    will-change: transform, box-shadow, filter;
    filter: brightness(1.15) saturate(1.3);
    transform-origin: center center !important;
}

/* 特别针对最大标签的悬停效果 */
.tag-hot-10:hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
    z-index: 100 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
    filter: brightness(1.15) saturate(1.3) !important;
    transform-origin: center center !important;
}

/* 中心标签悬停效果 - 覆盖动画 */
.tag-item.center-tag:hover {
    transform: translate(-50%, -50%) scale(1.08) !important;
    z-index: 100 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
    filter: brightness(1.15) saturate(1.3) !important;
    transform-origin: center center !important;
    animation: none !important;
}

/* 搜索高亮效果 - 简化版本 */
.tag-item.highlight {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7) !important;
    color: #856404 !important;
    border-color: #ffc107 !important;
    z-index: 50 !important;
}

/* 中心标签特殊效果 - 动态颜色变化 */
.tag-item.center-tag {
    animation: centerGlow 3s ease-in-out infinite alternate, colorShift 8s ease-in-out infinite;
    will-change: transform, box-shadow, filter;
}

@keyframes centerGlow {
    0% { 
        box-shadow: 0 0 15px rgba(0,0,0,0.2);
        transform: translate(-50%, -50%) scale(1);
    }
    100% { 
        box-shadow: 0 0 25px rgba(0,0,0,0.4);
        transform: translate(-50%, -50%) scale(1.01);
    }
}

@keyframes colorShift {
    0% { filter: hue-rotate(0deg) brightness(1); }
    25% { filter: hue-rotate(90deg) brightness(1.05); }
    50% { filter: hue-rotate(180deg) brightness(1.1); }
    75% { filter: hue-rotate(270deg) brightness(1.05); }
    100% { filter: hue-rotate(360deg) brightness(1); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tag-cloud-container {
        height: 500px;
    }
    
    .tag-item {
        padding: 0.2rem 0.6rem;
        border-radius: 15px;
        font-weight: 700;
        text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    }
    
    /* 移动端字体大小调整 - 确保清晰度 */
    .tag-hot-1 { font-size: 0.6rem; font-weight: 700; }
    .tag-hot-2 { font-size: 0.8rem; font-weight: 700; }
    .tag-hot-3 { font-size: 1.0rem; font-weight: 700; }
    .tag-hot-4 { font-size: 1.2rem; font-weight: 800; }
    .tag-hot-5 { font-size: 1.4rem; font-weight: 800; }
    .tag-hot-6 { font-size: 1.6rem; font-weight: 800; }
    .tag-hot-7 { font-size: 1.8rem; font-weight: 800; }
    .tag-hot-8 { font-size: 2.0rem; font-weight: 900; }
    .tag-hot-9 { font-size: 2.2rem; font-weight: 900; }
    .tag-hot-10 { font-size: 2.4rem; font-weight: 900; }
}

@media (max-width: 480px) {
    .tag-cloud-container {
        height: 400px;
}

.tag-item {
        padding: 0.15rem 0.5rem;
        border-radius: 12px;
        font-weight: 800;
        text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    }
    
    /* 小屏幕字体大小 - 确保清晰度 */
    .tag-hot-1 { font-size: 0.5rem; font-weight: 800; }
    .tag-hot-2 { font-size: 0.7rem; font-weight: 800; }
    .tag-hot-3 { font-size: 0.9rem; font-weight: 800; }
    .tag-hot-4 { font-size: 1.1rem; font-weight: 900; }
    .tag-hot-5 { font-size: 1.3rem; font-weight: 900; }
    .tag-hot-6 { font-size: 1.5rem; font-weight: 900; }
    .tag-hot-7 { font-size: 1.7rem; font-weight: 900; }
    .tag-hot-8 { font-size: 1.9rem; font-weight: 900; }
    .tag-hot-9 { font-size: 2.1rem; font-weight: 900; }
    .tag-hot-10 { font-size: 2.3rem; font-weight: 900; }
}

/* 标签云图导航样式 - 与cloud.html完全一致 */
.first-level-section {
    margin-bottom: 1rem;
}

.first-level-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.first-level-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.first-level-icon {
    font-size: 0.8rem;
}

.breadcrumb-area {
    margin-bottom: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f8f9fa;
}

   /* 字母分区域样式 */
   .tag-letter-section {
    margin-bottom: 2rem;
}

.tag-letter-section h4 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.tag-letter-section hr {
    border-top: 2px solid var(--bs-primary);
    opacity: 0.3;
}

/* 字母导航按钮样式 */
.letter-nav-btn {
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.letter-nav-btn:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.letter-nav-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.letter-nav-btn.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.letter-nav-btn.active:hover {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.letter-nav-btn.active .badge {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 迷你标签卡片样式 - 一页显示所有标签 */
.tag-card-mini {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
    min-height: 140px;
    cursor: pointer;
}

.tag-card-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

.tag-card-mini .card-title a:hover {
    color: var(--bs-primary) !important;
}

.tag-card-mini .card-body {
    padding: 0.75rem !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* 迷你布局优化 */
.tag-card-mini .row.g-0 {
    margin: 0;
}

.tag-card-mini .row.g-0>* {
    padding: 0;
}

/* 响应式优化 */
@media (max-width: 1200px) {
    .tag-card-mini .card-body {
        padding: 0.2rem !important;
    }
}

@media (max-width: 768px) {
    .tag-card-mini .card-body {
        padding: 0.15rem !important;
    }

    .tag-card-mini .row.g-0 .col-6 {
        margin-bottom: 0.05rem;
    }
}

@media (max-width: 576px) {
    .tag-card-mini .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.1rem;
    }
}

/* 超紧凑标签卡片样式（保留作为备用） */
.tag-card-ultra-compact {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px;
    min-height: 120px;
}

.tag-card-ultra-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
}

.tag-card-ultra-compact .card-title a:hover {
    color: var(--bs-primary) !important;
}

.tag-card-ultra-compact .card-body {
    padding: 0.5rem !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* 紧凑标签卡片样式（保留作为备用） */
.tag-card-compact {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
}

.tag-card-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.tag-card-compact .card-title a:hover {
    color: var(--bs-primary) !important;
}

.tag-card-compact .card-body {
    padding: 0.75rem !important;
}

/* 小徽章样式 */
.badge-sm {
    font-size: 0.6rem;
    padding: 0.25rem 0.4rem;
}

.content-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.content-card .card-title a:hover {
    color: var(--bs-primary) !important;
}

.btn-group .btn {
    border-radius: 0.375rem;
}

.btn-group .btn:not(:last-child) {
    margin-right: 0.25rem;
}

@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
}
