/* 主内容区 */
.hero {
    height: 15vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, var(--secondary-bg), var(--accent-color), var(--primary-bg));
    animation: rotate 20s linear infinite;
    opacity: 0.1;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    padding: 0 20px;
}

.hero h1 {
    font-size: 7vh;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--accent-color);
    animation: glow 2s ease-in-out infinite;
    background: linear-gradient(90deg, #1cbfff, #8a2be2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto;
}

@keyframes glow {
    0%,
    100% {
        text-shadow: 0 0 20px var(--accent-color);
    }

    50% {
        text-shadow: 0 0 40px var(--accent-color), 0 0 60px var(--accent-color);
    }
}

/* 轮播图 */
.carousel {
    position: relative;
    max-width: 1800px;
    margin: 3rem auto;
    height: 50vh;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.3);
    touch-action: pan-y; /* 允许垂直滚动但防止水平滚动冲突 */
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    transition: transform 0.5s ease; /* 添加滑动过渡效果 */
}

.carousel-item {
    flex: 0 0 100%;
    position: relative;
    width: 100%;
    height: 100%;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: rgba(var(--primary-bg-rgb), 0.7);
    padding: 1rem;
    border-radius: 10px;
    max-width: 50%;
    backdrop-filter: blur(5px);
    pointer-events: none;
}

.carousel-caption h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-size: 3vh;
}

.carousel-caption p {
    color: var(--text-color);
    opacity: 0.9;
    font-size: 1rem;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 100;
}

.carousel-indicator {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(190, 190, 190, 0.5);
    cursor: pointer;
    transition: 0.3s;
    pointer-events: auto;
}

.carousel-indicator.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--accent-color);
    font-size: 1.2rem;
}

/* 新番展示区域样式 */
.anime-section {
    max-width: 1800px;
    margin: 2rem auto;
    padding: 1rem;
    border-radius: 15px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.2);
}

.section-header h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2::before {
    content: '';
    display: block;
    width: 5px;
    height: 1.8rem;
    background: var(--accent-color);
    border-radius: 3px;
}

.section-header a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.section-header a:hover {
    text-decoration: underline;
}

.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

/* 移动端样式 - 屏幕宽度小于768px时 */
@media (max-width: 768px) {
    .anime-grid {
        grid-template-columns: repeat(3, 1fr); /* 固定3列 */
        gap: 0;
    }
    .anime-item h4 {
        font-size: 1.35vh;
    }
    .hero {
        display: none;
    }
}

.anime-item {
    background: var(--card-bg);
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(var(--accent-color-rgb), 0.1);
}

.anime-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(var(--accent-color-rgb), 0.2);
    border-color: rgba(var(--accent-color-rgb), 0.3);
}

.anime-item .img-container {
    position: relative;
    width: 100%;
    padding-top: 140%;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.1);
}

.anime-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.anime-item:hover img {
    transform: scale(1.05);
}

.anime-item h4 {
    font-size: 1.5vh;
    color: var(--text-color);
    margin-top: 0.8rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
}

.anime-item .episode {
    font-size: 1.4vh;
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.1);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 0.3rem;
}

.anime-item .year {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 0.2rem;
}

.anime-item .view-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
}


/* 新番更新表 */
.week-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 5px;
    flex-wrap: wrap;
}

.week-btn, .nav-btn{
    line-height: 2;
    display: inline-block;  /* 让元素变成行内块级 */
    white-space: nowrap;    /* 禁止内部文字换行 */
    padding: 0.5vh 1vh;
    background: var(--card-bg);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    color: var(--text-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.week-btn.active, .week-btn:hover .nav-btn{
    background: var(--accent-color);
    color: #fff;
    border-color: transparent;
}

/* 加载指示器 */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    width: 100%;
}

.loader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(var(--accent-color-rgb), 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}