/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulseScale {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

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

@keyframes pulse-slow {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* 动画工具类 */
.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-pulse-scale {
    animation: pulseScale 2s ease-in-out infinite;
}

.animate-slide-in-up {
    animation: slideInUp 0.5s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.5s ease-out forwards;
}

.animate-pulse-slow {
    animation: pulse-slow 3s ease-in-out infinite;
}

/* 基础样式 */
body {
    font-family: 'Inter', 'system-ui', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #121212;
    color: #ffffff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 视频卡片样式 */
.group .bg-dark-800 {
    transition: all 0.3s ease;
}

.group .bg-dark-800:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(255, 107, 0, 0.15), 0 8px 10px -6px rgba(255, 107, 0, 0.1);
    border-color: rgba(255, 107, 0, 0.4);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 107, 0, 0.5);
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 107, 0, 0.7);
}

/* 输入框和按钮样式增强 */
input:focus, button:focus {
    outline: none;
}

input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #2D2D2D inset;
    -webkit-text-fill-color: white;
}

input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #2D2D2D inset;
    -webkit-text-fill-color: white;
}

button:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* 渐变背景 */
.bg-gradient-orange {
    background: linear-gradient(135deg, #FF6B00 0%, #FF9D42 100%);
}

/* Vant组件样式适配 */
.van-loading__spinner {
    width: 24px;
    height: 24px;
    border-color: #ffffff !important;
}

.van-list__loading {
    padding: 20px 0;
    color: #ffffff !important;
    font-size: 14px;
}

.van-toast {
    background-color: rgba(20, 20, 20, 0.85) !important;
    color: white !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    padding: 8px 16px !important;
}

.van-toast--success {
    background-color: rgba(255, 107, 0, 0.85) !important;
}

.van-toast--fail {
    background-color: rgba(239, 68, 68, 0.85) !important;
}

.van-toast--loading .van-loading__spinner {
    border-color: #ffffff !important;
}

.van-dialog {
    background-color: #2D2D2D !important;
    border-radius: 12px !important;
}

.van-dialog__header {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    border-bottom: 1px solid #3D3D3D !important;
}

.van-dialog__content {
    color: #ffffff !important;
}

.van-dialog__footer {
    border-top: 1px solid #3D3D3D !important;
}

.van-field {
    background-color: #2D2D2D !important;
    border-radius: 8px !important;
    color: #ffffff !important;
}

.van-field__placeholder {
    color: #9CA3AF !important;
}

.van-radio__label {
    color: #ffffff !important;
}

.van-radio__icon {
    border-color: #4B5563 !important;
}

.van-radio__icon--checked {
    background-color: #FF6B00 !important;
    border-color: #FF6B00 !important;
}

.van-radio__icon--checked .van-radio__inner {
    border-color: #ffffff !important;
}

.van-pull-refresh__head {
    color: #9CA3AF !important;
}

.van-pull-refresh__text {
    color: #9CA3AF !important;
}

/* 自定义工具类 */
.content-auto {
    content-visibility: auto;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* 呼吸效果 */
.breathing {
    animation: orangeBreathing 3s ease-in-out infinite;
}

@keyframes orangeBreathing {
    0% {
        box-shadow: 0 0 5px rgba(230, 81, 0, 0.2), 0 0 10px rgba(230, 81, 0, 0.1);
        background-color: #1a1a1a;
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 109, 0, 0.5), 0 0 30px rgba(255, 109, 0, 0.3);
        background-color: #252525;
    }
    100% {
        box-shadow: 0 0 5px rgba(230, 81, 0, 0.2), 0 0 10px rgba(230, 81, 0, 0.1);
        background-color: #1a1a1a;
    }
}

/* 视频播放器样式 */
#mse {
    position: relative;
    z-index: 10;
}

/* 粘性头部样式 */
.sticky {
    transition: all 0.3s ease;
}

.sticky.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 底部导航栏样式增强 */
footer {
    transition: all 0.3s ease;
}

/* 会员信息栏样式 */
.fixed.bottom-16 {
    transition: all 0.3s ease;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .van-dialog {
        width: 80% !important;
        margin: 0 auto;
    }
    
    .van-dialog__header {
        font-size: 15px !important;
    }
    
    .van-dialog__footer button {
        font-size: 14px !important;
    }
}

/* 触摸反馈优化 */
.touch-feedback {
    -webkit-tap-highlight-color: transparent;
}

/* 加载骨架屏动画 */
.skeleton-loading {
    background: linear-gradient(90deg, #2D2D2D 25%, #3D3D3D 50%, #2D2D2D 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* 图片加载失败样式 */
.img-error {
    background-color: #3D3D3D;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-error::before {
    content: '🖼️';
    font-size: 24px;
    opacity: 0.5;
}

/* 性能优化 */
.hardware-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* 文本选中样式 */
::selection {
    background-color: rgba(255, 107, 0, 0.3);
    color: white;
}

/* 焦点状态样式 */
.focus-visible {
    outline: 2px solid #FF6B00;
    outline-offset: 2px;
}

/* 辅助功能 - 高对比度模式支持 */
@media (prefers-contrast: high) {
    .group .bg-dark-800:hover {
        border-color: #FF6B00;
    }
    
    .van-button--primary {
        background-color: #FF6B00 !important;
        border-color: #FF6B00 !important;
    }
}

/* 辅助功能 - 减少动画 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}