/* 自定义工具类 */
@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .text-shadow {
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    .text-gradient {
        background-clip: text;
        -webkit-background-clip: text;
        color: transparent;
    }
    .card-hover {
        transition: all 0.3s ease;
    }
    .card-hover:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    .progress-bar {
        position: fixed;
        top: 0;
        left: 0;
        height: 2px;
        background: linear-gradient(to right, #0078D7, #E63946, #FFD700);
        z-index: 9999;
    }
    .video-item-container {
        position: relative;
        width: 100%;
        max-width: 640px;
        margin: 0 auto;
        aspect-ratio: 16/9;
        overflow: hidden;
    }
    .video-element {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .video-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.3s ease;
        cursor: pointer;
    }
    .video-item-container:hover .video-overlay {
        opacity: 1;
    }
    .delay-100 { animation-delay: 100ms; }
    .delay-200 { animation-delay: 200ms; }
    .delay-300 { animation-delay: 300ms; }
    
    /* 添加高级按钮样式 */
    .btn-gradient {
        position: relative;
        overflow: hidden;
        z-index: 1;
        transition: all 0.3s ease;
    }
    .btn-gradient::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: all 0.5s ease;
        z-index: -1;
    }
    .btn-gradient:hover::before {
        left: 100%;
    }
    .hover-lift {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .hover-lift:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px -5px rgba(0, 120, 215, 0.3);
    }
    .doraemon-shadow {
        box-shadow: 0 4px 15px rgba(0, 120, 215, 0.2);
    }
}

/* 全局基础样式 */
body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 暗色模式样式 */
body.dark-mode {
    background-color: #1a1a1a;
    color: #f5f5f5;
}

body.dark-mode main { background-color: rgba(26, 26, 26, 0.8); }
body.dark-mode #navbar { background-color: #2d2d2d; }
body.dark-mode .bg-doraemon-face { background-color: #2d2d2d; color: #f5f5f5; }
body.dark-mode .bg-doraemon-white { background-color: #2d2d2d; color: #f5f5f5; }
body.dark-mode .text-gray-800 { color: #f5f5f5; }
body.dark-mode .text-gray-600 { color: #cccccc; }
body.dark-mode .text-gray-700 { color: #e0e0e0; }
body.dark-mode .border-l-4 { border-color: #e63946; }
body.dark-mode .bg-doraemon-blue\/5 { background-color: rgba(0, 120, 215, 0.1); }
body.dark-mode .bg-gradient-to-b { background-image: linear-gradient(to bottom, #2d2d2d, #1a1a1a); }
body.dark-mode .video-overlay { background-color: rgba(0, 0, 0, 0.5) !important; }
body.dark-mode #bg-image { filter: brightness(0.5) contrast(1.2); }

/* 滚动条样式 - 暗色模式 */
body.dark-mode ::-webkit-scrollbar-track { background: #333; }
body.dark-mode ::-webkit-scrollbar-thumb { background: #555; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #777; }

/* 背景图容器样式 */
#bg-image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 1;
}

#bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 导航栏滚动效果 */
#navbar.navbar-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 添加到styles.css文件末尾 */

/* 视频控件样式增强 */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.video-item-container:hover .video-controls {
    opacity: 1;
}

.video-controls:hover {
    opacity: 1 !important;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0078D7, #E63946);
    border-radius: 2px;
    transition: width 0.1s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.progress-container:hover .progress-bar::after {
    opacity: 1;
}

/* 控制按钮样式 */
.play-btn, .mute-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.play-btn:hover, .mute-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 时间显示样式 */
.time-display {
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.9);
}

/* 视频覆盖层效果增强 */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 5;
}

/* 播放图标动画 */
.video-overlay i {
    transform: scale(1);
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.video-overlay:hover i {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
}

/* 视频加载动画 */
.video-element {
    background: rgba(0, 0, 0, 0.2);
}

/* 全屏样式 */
.video-item-container:fullscreen {
    background: black;
}

/* 视频卡片效果 */
.video-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .video-controls {
        padding: 8px;
    }
    
    .play-btn, .mute-btn {
        font-size: 1.5rem;
    }
    
    .video-overlay i {
        font-size: 5rem !important;
    }
}

/* 页脚样式优化 */
footer.bg-black {
    background-color: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer.bg-black .text-doraemon-white\/80 {
    color: rgba(255, 255, 255, 0.8);
}

footer.bg-black a:hover {
    color: #0078D7 !important;
}

/* 导航栏样式增强 */
#navbar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbar.scrolled {
    background-color: rgba(0, 120, 215, 0.95);
    backdrop-filter: blur(8px);
}

/* 导航链接样式优化 */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #FFD700;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* 移动端菜单动画增强 */
#mobile-menu {
    transition: background-color 0.3s ease;
}

#mobile-menu.active .bg-doraemon-face {
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 用户头像悬停效果 */
#user-avatar, #mobile-menu-avatar {
    transition: all 0.3s ease;
}

#user-avatar:hover, #mobile-menu-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

/* 管理面板按钮增强 */
.btn-gradient {
    position: relative;
    overflow: hidden;
}

.btn-gradient::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.5s ease;
}

.btn-gradient:hover::before {
    left: 100%;
}

/* 确保移动端导航在小屏幕上完全适配 */
@media (max-width: 640px) {
    #navbar .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .nav-link {
        font-size: 0.95rem;
    }
}

/* 导航栏优化样式 */
#navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#navbar nav {
    flex: 1;
}

/* 用户菜单容器优化 */
#user-menu-container {
    align-items: center;
}

/* 功能按钮组样式统一 */
#auth-container a, #auth-container button {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 移动菜单优化 */
#mobile-menu .bg-doraemon-face {
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 100vh;
    overflow-y: auto;
}

/* 修复移动端登出链接样式 */
#mobile-menu a[href="logout.php"] {
    margin-left: 0 !important;
    padding: 0.5rem 1rem !important;
    width: auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #navbar {
        padding: 0.5rem 0;
    }
    
    #navbar .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* 确保管理后台按钮在桌面端和移动端都有良好的样式 */
.btn-gradient {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-gradient::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.5s ease;
    z-index: -1;
}

.btn-gradient:hover::before {
    left: 100%;
}