/* ========================================
   番剧页面样式 - Anime Page Styles (Butterfly)
   ======================================== */

/* ========================================
   强制全屏布局 - 隐藏所有 butterfly 主题元素
   ======================================== */
body.type-anime,
body.type-animeDetails {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background: #16213e !important; /* 使用单一颜色 */
}

/* 隐藏 butterfly 主题的背景、侧边栏等，但保留导航栏和 footer */
body.type-anime #web_bg,
body.type-anime #sidebar,
body.type-anime #rightside,
body.type-anime #page-header,
body.type-animeDetails #web_bg,
body.type-animeDetails #sidebar,
body.type-animeDetails #rightside,
body.type-animeDetails #page-header {
    display: none !important;
}

/* 确保 footer 显示并设置与页面一致的背景色 */
body.type-anime #footer,
body.type-animeDetails #footer {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    margin-top: 0 !important; /* 移除上边距，消除间隙 */
    background: #16213e !important; /* 使用单一颜色 */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding-top: 40px; /* 添加内边距而不是外边距 */
}

/* footer 内部元素文字颜色 */
body.type-anime #footer *,
body.type-animeDetails #footer * {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* footer 链接样式 */
body.type-anime #footer a,
body.type-animeDetails #footer a {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: color 0.3s ease;
}

body.type-anime #footer a:hover,
body.type-animeDetails #footer a:hover {
    color: #ff6b9d !important;
}

/* 全屏内容容器 */
.fullscreen-anime-wrapper {
    width: 100vw;
    min-height: auto; /* 改为 auto，让内容自然撑开 */
    position: relative;
    margin: 0;
    padding: 0;
}

/* 确保导航栏显示 - 纯透明效果 */
body.type-anime #nav,
body.type-animeDetails #nav {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    height: 60px !important;
    align-items: center !important;
    padding: 0 40px !important;
}

body.type-anime #nav #blog-info,
body.type-animeDetails #nav #blog-info {
    display: flex;
    align-items: center;
}

body.type-anime #nav .nav-site-title,
body.type-animeDetails #nav .nav-site-title {
    display: flex;
    align-items: center;
    color: #fff !important;
    text-decoration: none;
}

body.type-anime #nav .site-icon,
body.type-animeDetails #nav .site-icon {
    height: 35px;
    margin-right: 10px;
}

body.type-anime #nav .site-name,
body.type-animeDetails #nav .site-name {
    color: #fff !important;
    font-size: 1.3em;
    font-weight: bold;
}

body.type-anime #nav #menus,
body.type-animeDetails #nav #menus {
    display: flex;
    align-items: center;
    margin-left: auto;
}

body.type-anime #nav .menus_items,
body.type-animeDetails #nav .menus_items {
    display: flex;
    align-items: center;
}

body.type-anime #nav .menus_item a,
body.type-anime #nav .menus_item span,
body.type-animeDetails #nav .menus_item a,
body.type-animeDetails #nav .menus_item span {
    color: #fff !important;
}

body.type-anime #nav .menus_item a:hover,
body.type-animeDetails #nav .menus_item a:hover {
    color: #ff6b9d !important;
}

body.type-anime #nav #search-button .search,
body.type-animeDetails #nav #search-button .search {
    color: #fff !important;
}

body.type-anime #nav #toggle-menu,
body.type-animeDetails #nav #toggle-menu {
    color: #fff !important;
}

.anime-page {
    min-height: 100vh;
    background: #16213e; /* 使用单一颜色 */
    padding-top: 0; /* 内容从顶部开始，透过半透明导航栏显示 */
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   全屏加载状态
   ======================================== */
.anime-loading-overlay {
    position: fixed;
    top: 0; /* 从页面顶部开始 */
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #16213e; /* 使用单一颜色 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 998; /* 低于导航栏 */
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    gap: 20px;
    transition: opacity 0.3s ease;
}

.anime-loading-overlay .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 107, 157, 0.2);
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* 粒子背景 */
.anime-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 107, 157, 0.6);
    border-radius: 50%;
    animation: floatUp 15s linear infinite;
}

.particle:nth-child(odd) {
    background: rgba(78, 205, 196, 0.6);
    width: 3px;
    height: 3px;
}

.particle:nth-child(3n) {
    background: rgba(255, 209, 102, 0.5);
    width: 5px;
    height: 5px;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* ========================================
   顶部轮播图区域 - 延伸到页面顶部（透过半透明导航栏显示）
   ======================================== */
.anime-carousel-section {
    position: relative;
    z-index: 1;
    padding: 0 0 30px;
    margin-top: 0;
}

.anime-carousel {
    position: relative;
    width: 100%;
    height: 560px; /* 500px + 60px导航栏高度 */
    overflow: hidden;
}

.carousel-container {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

/* 背景图 - 显示上半部分，无虚化 */
.carousel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    object-fit: cover;
    object-position: top center;
    filter: brightness(0.5);
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.carousel-slide:hover .carousel-bg {
    transform: scale(1.1);
}

/* 渐变遮罩 */
.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to right,
        rgba(15, 15, 35, 0.95) 0%,
        rgba(15, 15, 35, 0.7) 30%,
        rgba(15, 15, 35, 0.3) 60%,
        rgba(15, 15, 35, 0.5) 100%
    );
    z-index: 1;
}

.carousel-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, rgba(15, 15, 35, 1), transparent);
    z-index: 1;
}

/* 轮播内容 */
.carousel-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 80px 80px 40px;
    z-index: 2;
    gap: 50px;
}

.carousel-poster {
    width: 220px;
    height: 320px;
    object-fit: cover;
    object-position: top center;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 107, 157, 0.3);
    flex-shrink: 0;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.carousel-slide:hover .carousel-poster {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 107, 157, 0.5);
}

.carousel-info {
    flex: 1;
    color: #fff;
    max-width: 600px;
}

.carousel-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin: 0 0 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.carousel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.carousel-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.carousel-meta i {
    color: #ff6b9d;
}

.carousel-rating {
    background: linear-gradient(135deg, #ff6b9d, #c44569) !important;
    color: #fff !important;
    font-weight: 600;
}

.carousel-summary {
    font-size: 1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.75);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* 轮播控制 */
.carousel-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
    pointer-events: none;
}

.carousel-arrow {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.carousel-arrow:hover {
    background: rgba(255, 107, 157, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.5);
}

.carousel-arrow i {
    color: #fff;
    font-size: 1.2rem;
}

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

.carousel-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.carousel-dot.active {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    width: 30px;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(255, 107, 157, 0.6);
}

/* ========================================
   主内容区域
   ======================================== */
.anime-main-content {
    display: flex;
    gap: 30px;
    padding: 0 30px 50px;
    position: relative;
    z-index: 1;
}

.anime-sidebar {
    width: 200px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-nav {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: inherit;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    height: 100px;
}

.sidebar-item:last-child { margin-bottom: 0; }

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.3), rgba(196, 69, 105, 0.3));
    color: #fff;
    border: 1px solid rgba(255, 107, 157, 0.5);
}

.sidebar-item i { 
    font-size: 1.2rem; 
    width: 24px; 
    text-align: center;
    flex-shrink: 0;
    height: 20px;
}

.sidebar-item span { 
    font-size: 0.95rem; 
    font-weight: 500;
    line-height: 1.2;
}

.anime-content-area {
    flex: 1;
    min-width: 0;
}

.content-panel {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.content-panel.active { display: block; }

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

.section-block { margin-bottom: 40px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.section-title i { color: #ff6b9d; font-size: 1.3rem; }

.view-more-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-more-btn:hover {
    background: rgba(255, 107, 157, 0.3);
    border-color: rgba(255, 107, 157, 0.5);
    color: #fff;
}

.view-more-btn i {
    transition: transform 0.3s ease;
}

/* ========================================
   番剧卡片
   ======================================== */
.anime-card-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

/* 可展开的卡片行 */
.anime-card-row.expandable {
    max-height: none;
    overflow: hidden;
    transition: all 0.5s ease;
}

.anime-card-row.expandable.expanded {
    animation: expandIn 0.5s ease;
}

@keyframes expandIn {
    from {
        opacity: 0.8;
    }
    to {
        opacity: 1;
    }
}

.anime-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.anime-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 107, 157, 0.2);
    border-color: rgba(255, 107, 157, 0.3);
}

.anime-card-poster {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.anime-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.anime-card:hover .anime-card-poster img { transform: scale(1.1); }

.anime-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.anime-card:hover .anime-card-overlay { opacity: 1; }

.anime-card-play {
    width: 50px;
    height: 50px;
    background: rgba(255, 107, 157, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.anime-card:hover .anime-card-play { transform: scale(1); }
.anime-card-play i { color: #fff; font-size: 1.3rem; }

.anime-card-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.9), rgba(196, 69, 105, 0.9));
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.anime-card-title {
    padding: 15px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   时间表
   ======================================== */
.schedule-weekdays {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.weekday-btn {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.weekday-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }

.weekday-btn.active {
    background: linear-gradient(135deg, #ff6b9d, #c44569);
    color: #fff;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
}

.schedule-anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    min-height: 200px;
}

/* ========================================
   站长推荐
   ======================================== */
.recommend-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.recommend-card {
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    width: 95%;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.recommend-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 107, 157, 0.3);
}

.recommend-poster { 
    width: 200px; 
    flex-shrink: 0; 
}

.recommend-poster img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.recommend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recommend-title {
    padding-top: 0;
    font-size: 1.6rem;
    font-weight: 600;
    color: #fff;
    margin-top: 0;
}

.recommend-stars { margin-bottom: 15px; }
.recommend-stars i { 
    color: #ffd166 !important; 
    font-size: 1rem; 
    margin-right: 3px; 
}
.recommend-stars i.empty { color: rgba(255, 255, 255, 0.2); }

.recommend-reason {
    font-size: 1.4rem;
    color: #ff6b9d !important;
    font-style: italic;
    margin: 0 0 15px;
    line-height: 1.3;
}

.recommend-summary {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   模态框
   ======================================== */
.anime-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.anime-modal.show { opacity: 1; visibility: visible; }

.modal-content {
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.anime-modal.show .modal-content { transform: scale(1); }

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover { background: rgba(255, 107, 157, 0.5); transform: rotate(90deg); }
.modal-close i { color: #fff; font-size: 1.2rem; }

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 30px;
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

/* ========================================
   加载状态
   ======================================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.6);
    gap: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 107, 157, 0.2);
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 12px;
}

.skeleton-card { aspect-ratio: 3/4; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1200px) {
    .anime-card-row { grid-template-columns: repeat(5, 1fr); }
    .carousel-content { padding: 30px 50px; }
    .carousel-title { font-size: 2rem; }
}

@media (max-width: 992px) {
    .anime-sidebar { display: none; }
    .anime-card-row { grid-template-columns: repeat(4, 1fr); }
    .carousel-poster { width: 180px; height: 260px; }
    .anime-carousel { height: 350px; }
}

@media (max-width: 768px) {
    .anime-main-content { padding: 0 15px 30px; }
    .anime-card-row { grid-template-columns: repeat(3, 1fr); gap: 15px; }
    .carousel-content { flex-direction: column; padding: 20px; text-align: center; }
    .carousel-poster { width: 140px; height: 200px; }
    .carousel-info { max-width: 100%; }
    .carousel-title { font-size: 1.5rem; }
    .carousel-meta { justify-content: center; gap: 10px; }
    .carousel-meta span { padding: 6px 12px; font-size: 0.85rem; }
    .carousel-summary { display: none; }
    .anime-carousel { height: 380px; }
    .recommend-grid { grid-template-columns: 1fr; }
    .recommend-card { flex-direction: column; text-align: center; }
    .recommend-poster { width: 120px; margin: 0 auto; }
    .schedule-weekdays { justify-content: center; }
}

@media (max-width: 480px) {
    .anime-card-row { grid-template-columns: repeat(2, 1fr); }
    .section-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .weekday-btn { padding: 10px 18px; font-size: 0.9rem; }
}
