/* 新首页自定义样式 - 九宫格布局 */
/* 使用主题变量 --accent-color1 和 --accent-color2 */

/* ========== 轮播图样式 ========== */
#heroCarousel {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.carousel-inner,
.carousel-item {
    height: 400px;
}

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev {
    display: flex;
}

.hero-slide {
    background: linear-gradient(135deg, var(--accent-color1) 0%, var(--accent-color2) 100%);
    height: 400px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.hero-content {
    max-width: 800px;
    color: white;
    text-align: center;
    z-index: 2;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 50px 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-abstract {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    line-height: 1.6;
    opacity: 0.95;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.hero-meta i {
    opacity: 0.8;
}

.hero-slide .btn-primary {
    background: white;
    color: var(--accent-color1);
    border: none;
    padding: 0.75rem 2rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.hero-slide .btn-primary:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(-50%);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* 轮播指示器 */
.carousel-indicators {
    margin-bottom: 1.5rem;
}

.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
}

.carousel-indicators .active {
    background-color: white;
}

/* 轮播控制按钮 */
.carousel-control-prev,
.carousel-control-next {
    width: 5%;
    opacity: 0.8;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .carousel-inner,
    .carousel-item,
    .hero-slide {
        height: 350px;
    }
    
    .hero-content {
        padding: 45px 1.5rem;
    }
    
    .hero-badge {
        top: 10px;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-abstract {
        font-size: 1rem;
    }
    
    .hero-slide .btn-primary {
        bottom: 10px;
    }
}

@media (max-width: 767.98px) {
    .carousel-inner,
    .carousel-item,
    .hero-slide {
        height: 300px;
    }
    
    .hero-content {
        padding: 40px 1rem;
    }
    
    .hero-badge {
        top: 10px;
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .hero-abstract {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .hero-slide .btn-primary {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
        bottom: 10px;
    }
}

/* ========== 卡片样式 ========== */
.card {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* 移除卡片悬停动画 */
.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* 卡片头部 - 固定高度，统一高度 */
.card-header {
    border-radius: 0 !important;
    font-weight: 600;
    padding: 0.6rem 1rem;
    height: 42px;
    display: flex;
    align-items: center;
}

.card-header h5 {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1;
}

/* 卡片头部按钮样式 */
.card-header .btn-sm {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    line-height: 1;
    height: auto;
}

/* 使用主题色的卡片头部 */
.card-header.bg-primary {
    background-color: var(--accent-color1) !important;
}

.card-header.bg-danger {
    background-color: #dc3545 !important;
}

.card-header.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.card-header.bg-success {
    background-color: #28a745 !important;
}

.card-header.bg-info {
    background-color: #17a2b8 !important;
}

.card-header.bg-secondary {
    background-color: #6c757d !important;
}

.card-header.bg-dark {
    background-color: #343a40 !important;
}

/* 模块列表样式 - 去掉滚动条 */
.module-list {
    max-height: none;
    overflow: visible;
}

/* 列表项样式 - 更紧凑，无动画 */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* 移除左移动画，只保留背景色变化 */
.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item-action {
    text-decoration: none;
    color: inherit;
}

/* 悬停时只变色，无动画 */
.list-group-item-action:hover {
    color: var(--accent-color1);
}

/* 文章标题容器 - 确保右侧有空白 */
.list-group-item .flex-grow-1 {
    min-width: 0;
    padding-right: 0.5rem;
}

/* 文章标题 - 横向溢出隐藏，不换行 */
.list-group-item .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* 徽章样式 */
.badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

/* 统计项样式 - 更紧凑，无动画 */
.stat-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
}

/* 移除统计项悬停动画 */
.stat-item:hover {
    background-color: #f8f9fa;
}

.stat-item h4 {
    font-weight: 700;
    color: #333;
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.stat-item small {
    font-size: 0.75rem;
}

.stat-item i {
    font-size: 1.5rem;
}

.stat-item i.text-primary {
    color: var(--accent-color1) !important;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .card-header h5 {
        font-size: 0.9rem;
    }
}

@media (max-width: 767.98px) {
    .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .card-header h5 {
        font-size: 0.85rem;
    }
    
    .list-group-item {
        padding: 0.4rem 0.75rem;
    }
}

/* 图标样式 - 更小 */
.bi {
    vertical-align: middle;
}

.list-group-item i {
    font-size: 0.9rem;
}

/* 图标颜色使用主题色 */
.list-group-item i.text-primary {
    color: var(--accent-color1) !important;
}

.list-group-item i.text-success {
    color: #28a745 !important;
}

.list-group-item i.text-info {
    color: #17a2b8 !important;
}

.list-group-item i.text-secondary {
    color: #6c757d !important;
}

.list-group-item i.text-dark {
    color: #343a40 !important;
}

.list-group-item i.text-warning {
    color: #ffc107 !important;
}

/* 按钮样式 - 更小 */
.btn-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
}

.card-header .btn-light:hover {
    background-color: var(--accent-color2);
    border-color: var(--accent-color2);
    color: #fff;
}

.card-header .btn-dark:hover {
    background-color: var(--accent-color2);
    border-color: var(--accent-color2);
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--accent-color1) 0%, var(--accent-color2) 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* 间距调整 - 更紧凑 */
.g-3 {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.mb-3 {
    margin-bottom: 0.75rem !important;
}

/* 排行榜数字样式 */
.badge.bg-danger {
    font-weight: 700;
    font-size: 0.75rem;
}

.badge.bg-secondary {
    font-weight: 600;
    font-size: 0.7rem;
}

/* 卡片内容区域 - 更紧凑 */
.card-body {
    padding: 0.75rem;
}

/* 第三行模块（常用文档、RSS订阅、网站统计）统一高度 */
.card-body.module-list,
.card-body.text-center,
.card-body:has(.stat-item) {
    min-height: 400px;
}

/* 常用文档列表样式 */
.card-body.module-list {
    display: flex;
    flex-direction: column;
}

.card-body.module-list .list-group {
    flex: 1;
}

/* RSS订阅卡片居中对齐 */
.card-body.text-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 网站统计卡片内容居中 */
.card-body:has(.stat-item) {
    display: flex;
    align-items: center;
}

/* 空状态样式 */
.text-muted.text-center {
    padding: 1rem;
    font-size: 0.85rem;
}

/* RSS订阅卡片特殊样式 */
.card-header[style*="linear-gradient"] i {
    color: #fff !important;
}

/* 订阅模块样式优化 */
.subscription-module {
    padding: 1.5rem 1rem;
}

.subscription-icon {
    font-size: 1.75rem;
    color: #667eea;
    margin-bottom: 0.75rem;
}

.subscription-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.subscription-desc {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.subscription-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.subscription-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid;
}

.subscription-btn i {
    font-size: 0.85rem;
}

.subscription-btn-primary {
    background-color: #667eea;
    border-color: #667eea;
    color: white;
}

.subscription-btn-primary:hover {
    background-color: #5568d3;
    border-color: #5568d3;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.subscription-btn-secondary {
    background-color: transparent;
    border-color: #6c757d;
    color: #6c757d;
}

.subscription-btn-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

/* 响应式调整 */
@media (max-width: 767.98px) {
    .subscription-module {
        padding: 1.25rem 0.75rem;
    }
    
    .subscription-icon {
        font-size: 1.5rem;
    }
    
    .subscription-title {
        font-size: 0.9rem;
    }
    
    .subscription-desc {
        font-size: 0.75rem;
    }
    
    .subscription-buttons {
        flex-direction: column;
        gap: 0.4rem;
    }
    
    .subscription-btn {
        width: 100%;
        justify-content: center;
        padding: 0.45rem 1rem;
    }
}

/* 暗色主题适配 */
[data-bs-theme="dark"] .subscription-title {
    color: #fff;
}

[data-bs-theme="dark"] .subscription-desc {
    color: #adb5bd;
}

[data-bs-theme="dark"] .subscription-btn-secondary {
    border-color: #adb5bd;
    color: #adb5bd;
}

[data-bs-theme="dark"] .subscription-btn-secondary:hover {
    background-color: #adb5bd;
    border-color: #adb5bd;
    color: #212529;
}

/* 主题色按钮 */
.btn-primary {
    background-color: var(--accent-color1);
    border-color: var(--accent-color1);
}

.btn-primary:hover {
    background-color: var(--accent-color2);
    border-color: var(--accent-color2);
}

.btn-outline-primary {
    color: var(--accent-color1);
    border-color: var(--accent-color1);
}

.btn-outline-primary:hover {
    background-color: var(--accent-color1);
    border-color: var(--accent-color1);
    color: #fff;
}

.btn-outline-secondary {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

/* 统计图标颜色 */
.stat-item i.text-warning {
    color: #ffc107 !important;
}

/* 日期显示 - 更小 */
.list-group-item small {
    font-size: 0.75rem;
}

/* 文章标题 - 更紧凑 */
.list-group-item .fw-semibold {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 前三条文章标题加粗 */
.list-group-item .fw-bold {
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 700;
}

/* 普通文章标题 */
.list-group-item .text-truncate {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 统计行间距 */
.row.text-center.g-2 {
    --bs-gutter-y: 0.5rem;
}

/* 暗色主题适配 */
[data-bs-theme="dark"] .card {
    background-color: #212529;
    border-color: #495057;
}

[data-bs-theme="dark"] .list-group-item {
    background-color: #212529;
    border-color: #495057;
    color: #fff;
}

[data-bs-theme="dark"] .list-group-item:hover {
    background-color: #2c3034;
}

[data-bs-theme="dark"] .stat-item:hover {
    background-color: #2c3034;
}

[data-bs-theme="dark"] .stat-item h4 {
    color: #fff;
}

/* 容器内边距调整 - 使用默认的container-fluid边距 */
.container-fluid {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
}

/* 确保行内容对齐 */
.row.g-3 {
    margin-left: -0.375rem;
    margin-right: -0.375rem;
}

.row.g-3 > * {
    padding-left: 0.375rem;
    padding-right: 0.375rem;
}

/* ========== 标签云样式 ========== */
.tag-cloud {
    padding: 1.5rem;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 手机端流式布局 */
.tag-cloud-mobile {
    display: flex;
    flex-wrap: wrap;
    row-gap: 0.75rem !important;
    column-gap: 0.75rem !important;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.tag-cloud-mobile-item {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    border-radius: 1.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 400;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    margin: 0;
}

.tag-cloud-mobile-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 1);
}

.tag-cloud-mobile-item:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 桌面端圆环布局容器 */
.tag-cloud-desktop {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 500px;
}

.tag-cloud-item {
    position: absolute;
    display: inline-block;
    padding: 0.25rem 0.65rem;
    color: rgba(255, 255, 255, 0.95);
    border-radius: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transform-origin: center;
    opacity: 0.85;
}

/* 光泽效果 */
.tag-cloud-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.tag-cloud-item:hover::before {
    left: 100%;
}

/* 悬停效果 */
.tag-cloud-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    color: rgba(255, 255, 255, 1);
    opacity: 1;
    z-index: 10;
}

/* 点击效果 */
.tag-cloud-item:active {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .tag-cloud {
        min-height: 400px;
    }
    
    .tag-cloud-desktop {
        min-height: 400px;
    }
    
    /* 平板设备上调整第三行模块高度 */
    .card-body.module-list,
    .card-body.text-center,
    .card-body:has(.stat-item) {
        min-height: 350px;
    }
}

/* 平板端优化（576px - 767px）*/
@media (max-width: 767.98px) and (min-width: 576px) {
    .tag-cloud {
        padding: 1rem;
        min-height: auto;
    }
    
    .tag-cloud-mobile {
        row-gap: 0.8rem !important;
        column-gap: 0.8rem !important;
        padding: 1rem;
    }
    
    .tag-cloud-mobile-item {
        padding: 0.55rem 1.15rem;
        font-size: 0.95rem;
    }
}

/* 手机端优化（<576px）*/
@media (max-width: 575.98px) {
    .tag-cloud {
        padding: 0.75rem;
        min-height: auto;
    }
    
    .tag-cloud-mobile {
        row-gap: 0.7rem !important;
        column-gap: 0.7rem !important;
        padding: 0.85rem;
    }
    
    .tag-cloud-mobile-item {
        padding: 0.5rem 1.05rem;
        font-size: 0.88rem;
    }
    
    /* 手机设备上取消第三行模块的最小高度限制 */
    .card-body.module-list,
    .card-body.text-center,
    .card-body:has(.stat-item) {
        min-height: auto;
    }
}

/* 暗色主题下的标签云 */
[data-bs-theme="dark"] .tag-cloud-item {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .tag-cloud-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}
