/**
 * 首页样式
 */

/* ========== 搜索区域 ========== */
.home-search-section {
    width: 100%;
    height: 20vh;
    background-image: url(../../images/pages/index/bg_search.webp);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索输入框 */
.home-search-section .search-input {
    width: 35%;
}

.home-search-section .search-input .el-input__inner {
    height: 60px;
    line-height: 60px;
    font-size: 15px;
    border-radius: 8px;
    padding-right: 50px;
}

.home-search-section .search-input .el-input__icon {
    font-size: 20px;
    cursor: pointer;
}

/* ========== 内容区域 ========== */
.home-content-section {
    width: 100%;
    background-image: linear-gradient(hsla(0,0%,88%,.5),hsla(0,0%,88%,.5)), url(../../images/pages/index/bg_content.webp);
    background-repeat: repeat;
    background-size: auto;
    background-color: #ffffff80;
    padding: 15px 0 35px;
}

/* 当通过 CSS 变量设置自定义背景图时，使用变量 */
.home-content-section[style*="--main-bg-url"] {
    background-image: linear-gradient(hsla(0,0%,88%,.5),hsla(0,0%,88%,.5)), var(--main-bg-url);
}


/* ========== 分类导航 ========== */
.home-category-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.horizontal-scrollbar {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  width: 0;
}

.scrollbar-wrap{
    scrollbar-width: none;
    margin-bottom: 0!important;
    margin-right: 0!important;
    overflow: auto;
}
.scrollbar-view {
    width: 100%;
}

.scrollbar-view > div {
    width: max-content;
}


/* 导航项 */
.category-nav-item {
    white-space: nowrap;
    font-size: 18px;
    font-weight: bold;
    color: var(--el-text-color-primary);
    margin-right: 15px;
    text-decoration: none!important;
    align-items: center;
    display: flex;
    flex-shrink: 0;
    height: 50px;
    min-width: 80px;
    padding: 0 10px;
    text-underline-offset: 10px;
    box-sizing: border-box;
    justify-content: center;
}
.category-nav-item span{
    align-items: center;
    display: inline-flex;
    justify-content: center;
}

.category-nav-item:hover {
    color: #409eff;
}

/* 更多按钮 */
.category-more-btn {
    flex: none;
    height: 50px;
    padding: 4px 10px;
    background-color: #ecf5ff;
    border-radius: 4px;
    color: #409eff;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-left: 10px;
    box-sizing: border-box;
}

.category-more-btn i {
    margin-left: 4px;
}

.category-more-btn:hover {
    background-color: #d9ecff;
    transform: translateY(-2px);
}

/* ========== 广告区域 ========== */
.home-ad-section {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    height: 22vw;
}

/* 左侧轮播图 */
.ad-carousel {
    width: 35%;
    height: 100%;
}

.ad-carousel .el-carousel {
    width: 100%;
    height: 100%;
}

.ad-carousel .el-carousel__container {
    height: 100%;
}

.ad-carousel .el-carousel__item {
    height: 100%;
}

.ad-carousel .el-carousel__item a {
    display: block;
    width: 100%;
    height: 100%;
}

.ad-carousel .el-carousel__item a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

/* 右侧广告 */
.ad-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4vw;
}

.ad-right-top,
.ad-right-bottom {
    display: flex;
    height: 10.8vw;
}

/* 广告项 */
.ad-item {
    flex: 1;
    display: block;
    height: 100%;
    text-decoration: none;
    overflow: hidden;
    border-radius: 5px;
}

.ad-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    display: block;
    transition: transform 0.3s ease;
}

.ad-item:hover img {
    transform: scale(1.08);
}

/* 上部分三等份 */
.ad-right-top .ad-item:not(:first-child) {
    margin-left: 10px;
}

/* 下部分二等份 */
.ad-right-bottom .ad-item:not(:first-child) {
    margin-left: 10px;
}

/* ========== 漫画推荐块 ========== */
.home-manga-recommend {
    margin-top: 30px;
}

/* 标题行 */
.recommend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.recommend-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--el-text-color-primary);
    margin: 0;
}

.recommend-more-btn {
    padding: 8px 15px;
    background-color: #409eff;
    border-radius: 20px;
    color: var(--el-bg-color);
    font-size: 14px;
    font-weight: normal;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.recommend-more-btn i {
    margin-left: 4px;
}

.recommend-more-btn:hover {
    background-color: #66b1ff;
}

/* 漫画列表 */
.manga-list {
    width: 100%;
}

/* 漫画项 */
.manga-item {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 0 5px;
    margin-bottom: 15px;
    transition: transform 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.manga-item:hover {
    transform: translateY(-4px);
    border-bottom-color: #f56c6c;
}

/* 漫画封面 */
.manga-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: var(--el-bg-color-overlay);
    border-radius: 5px;
    overflow: hidden;
}

.manga-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 遮罩层 */
.manga-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.manga-item:hover .manga-cover-overlay {
    opacity: 1;
}

.overlay-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
}

.overlay-author {
    font-size: 12px;
    color: var(--el-bg-color);
    text-align: center;
}

.overlay-status {
    font-size: 12px;
    color: var(--el-bg-color);
    text-align: center;
}

.overlay-read-btn {
    padding: 6px 20px;
    background-color: #f56c6c;
    color: var(--el-bg-color);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* 漫画信息 */
.manga-info {
    padding: 6px 0;
    margin: 0;
}

.manga-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 22px;
    color: #606266;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.manga-chapter {
    font-size: 14px;
    line-height: 16px;
    color: #606266;
    margin-top: 6px;
}

/* 论坛入口样式 - 蹦迪效果 */
.forum-entrance-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url(../../images/pages/index/bg_lt.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    position: relative;
    animation: boxPulse 1.5s ease-in-out infinite;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 整体盒子脉冲动画 */
@keyframes boxPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 20px rgba(255, 0, 255, 0.5),
            0 0 40px rgba(0, 255, 255, 0.3),
            0 8px 25px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 
            0 0 40px rgba(255, 0, 255, 0.8),
            0 0 80px rgba(0, 255, 255, 0.6),
            0 12px 35px rgba(0, 0, 0, 0.4);
    }
}

.forum-entrance-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 0, 255, 0.3),
        transparent,
        rgba(0, 255, 255, 0.3),
        transparent
    );
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.forum-entrance-box:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 
        0 0 50px rgba(255, 0, 255, 1),
        0 0 100px rgba(0, 255, 255, 0.8),
        0 15px 45px rgba(0, 0, 0, 0.5);
    text-decoration: none !important;
    animation: boxShake 0.3s ease-in-out infinite;
}

@keyframes boxShake {
    0%, 100% { transform: scale(1.05) translateY(-5px) rotate(0deg); }
    25% { transform: scale(1.05) translateY(-5px) rotate(-1deg); }
    75% { transform: scale(1.05) translateY(-5px) rotate(1deg); }
}

.forum-entrance-content {
    text-align: center;
    padding: 20px;
    color: white;
    text-decoration: none !important;
}

.forum-title {
    font-size: 36px;
    font-weight: 900;
    margin-bottom: 15px;
    text-decoration: none !important;
    display: flex;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

/* 每个字符的超级蹦迪动画 */
.forum-title-char {
    display: inline-block;
    animation: discoJump 0.8s ease-in-out infinite;
    text-decoration: none !important;
    filter: drop-shadow(0 0 15px currentColor);
    transform-origin: center bottom;
}

/* 超级蹦迪动画 - 快速跳动 + 3D旋转 + 霓虹渐变 */
@keyframes discoJump {
    0% {
        transform: translateY(0) scale(1) rotateY(0deg) rotateZ(0deg);
        text-shadow: 
            0 0 20px #ff00ff,
            0 0 40px #ff00ff,
            0 0 60px #ff00ff,
            0 5px 10px rgba(0, 0, 0, 0.5);
        color: #ff00ff;
    }
    12.5% {
        transform: translateY(-25px) scale(1.4) rotateY(180deg) rotateZ(-10deg);
        text-shadow: 
            0 0 30px #00ffff,
            0 0 60px #00ffff,
            0 0 90px #00ffff,
            0 8px 15px rgba(0, 0, 0, 0.6);
        color: #00ffff;
    }
    25% {
        transform: translateY(0) scale(1) rotateY(360deg) rotateZ(0deg);
        text-shadow: 
            0 0 20px #ffff00,
            0 0 40px #ffff00,
            0 0 60px #ffff00,
            0 5px 10px rgba(0, 0, 0, 0.5);
        color: #ffff00;
    }
    37.5% {
        transform: translateY(-25px) scale(1.4) rotateY(180deg) rotateZ(10deg);
        text-shadow: 
            0 0 30px #00ff00,
            0 0 60px #00ff00,
            0 0 90px #00ff00,
            0 8px 15px rgba(0, 0, 0, 0.6);
        color: #00ff00;
    }
    50% {
        transform: translateY(0) scale(1) rotateY(360deg) rotateZ(0deg);
        text-shadow: 
            0 0 20px #ff6600,
            0 0 40px #ff6600,
            0 0 60px #ff6600,
            0 5px 10px rgba(0, 0, 0, 0.5);
        color: #ff6600;
    }
    62.5% {
        transform: translateY(-25px) scale(1.4) rotateY(180deg) rotateZ(-10deg);
        text-shadow: 
            0 0 30px #ff0066,
            0 0 60px #ff0066,
            0 0 90px #ff0066,
            0 8px 15px rgba(0, 0, 0, 0.6);
        color: #ff0066;
    }
    75% {
        transform: translateY(0) scale(1) rotateY(360deg) rotateZ(0deg);
        text-shadow: 
            0 0 20px #6600ff,
            0 0 40px #6600ff,
            0 0 60px #6600ff,
            0 5px 10px rgba(0, 0, 0, 0.5);
        color: #6600ff;
    }
    87.5% {
        transform: translateY(-25px) scale(1.4) rotateY(180deg) rotateZ(10deg);
        text-shadow: 
            0 0 30px #ffffff,
            0 0 60px #ffffff,
            0 0 90px #ffffff,
            0 8px 15px rgba(0, 0, 0, 0.6);
        color: #ffffff;
    }
    100% {
        transform: translateY(0) scale(1) rotateY(360deg) rotateZ(0deg);
        text-shadow: 
            0 0 20px #ff00ff,
            0 0 40px #ff00ff,
            0 0 60px #ff00ff,
            0 5px 10px rgba(0, 0, 0, 0.5);
        color: #ff00ff;
    }
}

.forum-subtitle {
    font-size: 15px;
    margin-bottom: 18px;
    opacity: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    text-decoration: none !important;
    animation: fadeInOut 2s ease-in-out infinite;
}

/* 副标题淡入淡出动画 */
@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.forum-action {
    display: inline-block;
    padding: 12px 32px;
    background: linear-gradient(135deg, 
        rgba(255, 0, 255, 0.4), 
        rgba(0, 255, 255, 0.4),
        rgba(255, 255, 0, 0.4)
    );
    background-size: 200% 200%;
    border: 3px solid #ffffff;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    animation: buttonDisco 1s ease-in-out infinite, gradientShift 3s ease infinite;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

/* 按钮蹦迪动画 */
@keyframes buttonDisco {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 
            0 0 20px rgba(255, 0, 255, 0.8),
            0 0 40px rgba(0, 255, 255, 0.6),
            0 5px 20px rgba(0, 0, 0, 0.4);
        border-color: #ff00ff;
    }
    25% {
        transform: scale(1.15) rotate(-3deg);
        box-shadow: 
            0 0 30px rgba(0, 255, 255, 1),
            0 0 60px rgba(255, 255, 0, 0.8),
            0 8px 30px rgba(0, 0, 0, 0.5);
        border-color: #00ffff;
    }
    50% {
        transform: scale(1.2) rotate(3deg);
        box-shadow: 
            0 0 40px rgba(255, 255, 0, 1),
            0 0 80px rgba(255, 0, 255, 0.8),
            0 10px 40px rgba(0, 0, 0, 0.6);
        border-color: #ffff00;
    }
    75% {
        transform: scale(1.15) rotate(-3deg);
        box-shadow: 
            0 0 30px rgba(0, 255, 0, 1),
            0 0 60px rgba(255, 0, 255, 0.8),
            0 8px 30px rgba(0, 0, 0, 0.5);
        border-color: #00ff00;
    }
}


/* 渐变背景移动 */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.forum-entrance-box:hover .forum-action {
    animation: buttonDiscoFast 0.4s ease-in-out infinite, gradientShift 1s ease infinite;
    transform: scale(1.25) rotate(0deg);
}

@keyframes buttonDiscoFast {
    0%, 100% {
        transform: scale(1.25) rotate(-5deg);
        box-shadow:
            0 0 50px rgba(255, 0, 255, 1),
            0 0 100px rgba(0, 255, 255, 1),
            0 15px 50px rgba(0, 0, 0, 0.7);
    }
    50% {
        transform: scale(1.3) rotate(5deg);
        box-shadow:
            0 0 60px rgba(0, 255, 255, 1),
            0 0 120px rgba(255, 0, 255, 1),
            0 20px 60px rgba(0, 0, 0, 0.8);
    }
}

/* ========== 夜间模式样式 ========== */

/* 内容区域夜间模式 */
.dark-mode .home-content-section {
    background-image: linear-gradient(hsla(0,0%,15%,.85),hsla(0,0%,15%,.85)), url(../../images/pages/index/bg_content.webp);
    background-color: #0a0a0ad8;
}

/* 当使用自定义背景图时，夜间模式下的渐变 */
.dark-mode .home-content-section[style*="--main-bg-url"] {
    background-image: linear-gradient(hsla(0,0%,15%,.85),hsla(0,0%,15%,.85)), var(--main-bg-url);
}


/* 分类更多按钮夜间模式 */
.dark-mode .category-more-btn {
    background-color: #2a2a2a;
    color: #409eff;
}

.dark-mode .category-more-btn:hover {
    background-color: #363636;
}

/* 漫画标题和章节夜间模式 */
.dark-mode .manga-title {
    color: var(--el-text-color-primary);
}

.dark-mode .manga-chapter {
    color: var(--el-text-color-regular);
}

/* ========== 响应式媒体查询 ========== */

/* 屏幕宽度小于 880px */
@media screen and (max-width: 879px) {
    .category-nav-item {
        font-size: 14px;
    }
}

/* 屏幕宽度小于 375px */
@media screen and (max-width: 374px) {
    .category-nav-item {
        font-size: 12px;
    }
}