/* CSS 变量和基础样式 */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #fff;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    touch-action: pan-y;
    padding: 0;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ========== 容器样式 ========== */
.app-container {
    width: 100%;
    max-width: 600px;
    height: 100dvh;
    margin: 0 auto;
    padding: 0;
    position: relative;
}

/* ========== 性别切换按钮 ========== */
.gender-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gender-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
}

/* ========== 分类选择器 ========== */
.category-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10;
    padding: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    color: #fff;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3);
}

.category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    color: #fff;
}

/* ========== 下拉菜单 ========== */
.category-dropdown {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
}

.dropdown-toggle {
    background: rgba(201, 193, 193, 0.7);
    border: 2px solid transparent;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 550;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.3);
}

.dropdown-menu {
    position: fixed;
    top: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(134, 132, 132, 0.7);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    padding: 12px;
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 60vh;
    overflow-y: auto;
    justify-content: flex-start;
    align-content: flex-start;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    padding: 8px 10px;
    color: #fff;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 15px;
    background: transparent;
    border: none;
    text-align: center;
    white-space: nowrap;
    flex: 0 1 calc(25% - 5px);
    min-width: fit-content;
}

.dropdown-item:hover {
    background: rgba(235, 75, 75, 0.5);
}

.dropdown-item.active {
    background: var(--primary-color);
    font-weight: 600;
}

/* ========== 图标样式 ========== */
.icon-img {
    width: 25px;
    height: 25px;
    object-fit: contain;
}

/* ========== 视频播放器 ========== */
.video-wrapper {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: #000;
    margin-top: 0;
    height: 100%;
    touch-action: pan-y;
}

#video-element {
    width: 100%; /* 宽度100% */
    height: 100%; /* 高度100% */
    object-fit: cover; /* 填充覆盖 */
    border-radius: 0; /* 圆角 */
    cursor: default; /* 默认光标 */
}

/* ========== 视频反馈图标 ========== */
.video-feedback-icon {
    position: absolute; /* 绝对定位 */
    top: 50%; /* 顶部50% */
    left: 50%; /* 左侧50% */
    transform: translate(-50%, -50%); /* 居中 */
    width: 80px; /* 宽度 */
    height: 80px; /* 高度 */
    opacity: 0; /* 默认透明 */
    pointer-events: none; /* 不响应鼠标事件 */
    z-index: 50; /* 层级 */
}

.video-feedback-icon.show {
    animation: videoFeedbackFade 0.6s ease-out forwards; /* 播放淡出动画 */
}

.video-feedback-icon.pause {
    opacity: 1 !important; /* 暂停时保持显示 */
    animation: none !important; /* 不执行动画 */
}

@keyframes videoFeedbackFade {
    0% {
        opacity: 1; /* 初始：完全显示 */
        transform: translate(-50%, -50%) scale(1); /* 缩放1倍 */
    }
    100% {
        opacity: 0; /* 最终：完全透明 */
        transform: translate(-50%, -50%) scale(1.2); /* 缩放1.2倍 */
    }
}

.decorative-border {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 3px solid var(--primary-color);
    border-radius: 30px;
    opacity: 0.3;
    pointer-events: none;
}

/* ========== 浮动控制条 ========== */
.floating-controls {
    position: absolute;
    bottom: 35px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.control-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

.like-btn.active .icon-img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(85%) saturate(4921%) hue-rotate(325deg) brightness(101%) contrast(101%);
    animation: pulse 0.5s;
}

/* ========== 加载动画 ========== */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 200;
}

.spinner-circle {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(112, 112, 112, 0.397);
    border-top: 4px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ========== 关键帧动画 ========== */
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -120%) scale(1.5); }
    100% { opacity: 0; transform: translate(-50%, -150%) scale(2); }
}

/* ========== 浮动文本 ========== */
.floating-text {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary-color);
    font-weight: bold;
    animation: float 2s infinite;
}

/* ========== 通知样式 ========== */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

/* ========== 屏幕中央提示 ========== */
.center-tip {
    position: fixed; /* 固定定位，不随页面滚动 */
    bottom: 10%; /* 距离底部15% */
    left: 50%; /* 左侧位置设为50%，配合transform实现水平居中 */
    transform: translateX(-50%); /* 向左移动自身宽度的50%，实现完美水平中心定位 */
    background: rgba(119, 117, 117, 0.45); /* 半透明背景色 */
    backdrop-filter: blur(5px); /* 毛玻璃效果：模糊背景5px */
    color: #fff; /* 文字颜色：白色 */
    padding: 15px 20px; /* 内边距：上下15px，左右20px */
    border-radius: 15px; /* 圆角半径：15px */
    font-size: 25px; /* 字体大小：25px */
    font-weight: 600; /* 字体粗细：600（中等偏粗） */
    border: 2px solid rgba(241, 89, 255, 0.61); /* 边框：2px细线，61%透明度 */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(181, 82, 190, 0.2); /* 阴影：两层效果 - 深色阴影 + 光晕 */
    display: none; /* 默认隐藏 */
    align-items: center; /* Flexbox布局：垂直居中 */
    justify-content: center; /* Flexbox布局：水平居中 */
    z-index: 101; /* 层级：101（在大部分元素上方） */
    min-width: 100px; /* 最小宽度：100px     */
    text-align: center; /* 文字对齐：居中 */
    animation: centerTipFadeInOut 2s ease-in-out; /* 动画：淡入淡出，2秒，缓动效果 */
    cursor: pointer; /* 鼠标悬停时显示指针 */
}

.center-tip.show {
    display: flex;
}

@keyframes centerTipFadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
    .app-container {
        padding: 0;
    }
    .video-wrapper {
        margin-top: 0;
    }
    .gender-toggle {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    .category-selector {
        top: 15px;
        left: 15px;
        flex-wrap: wrap;
        max-width: calc(100% - 80px);
    }
    .category-btn,
    .dropdown-toggle {
        padding: 6px 10px;
        font-size: 12px;
    }
    .control-btn {
        width: 40px;
        height: 40px;
    }
    .center-tip {
        bottom: 8%;
        font-size: 16px;
        padding: 12px 16px;
        border-radius: 12px;
        min-width: 80px;
    }
}
