/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 视口容器 - 固定页面高度为可视高度，隐藏滚动条 */
.viewport-container {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #ffcce6 0%, #ccf2ff 50%, #e6ccff 100%);
    height: 100vh;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* 背景装饰动画 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-cat {
    position: absolute;
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    opacity: 0.7;
}

.cat-1 { top: 10%; left: 5%; animation-delay: 0s; }
.cat-2 { top: 20%; right: 8%; animation-delay: 1s; }
.cat-3 { bottom: 30%; left: 10%; animation-delay: 2s; }
.cat-4 { bottom: 15%; right: 15%; animation-delay: 3s; }
.cat-5 { top: 40%; left: 20%; animation-delay: 4s; }

.heart {
    position: absolute;
    font-size: 1.5rem;
    animation: heartbeat 2s ease-in-out infinite;
    opacity: 0.6;
}

.heart-2 { top: 25%; left: 80%; animation-delay: 0.5s; }
.heart-3 { bottom: 20%; right: 5%; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 0.9; }
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    height: calc(100vh - 40px); /* 减去padding */
    overflow-y: hidden; /* 移除滚动条 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* 返回首页按钮始终在底部 */
.back-home {
    margin-top: auto; /* 推到容器底部 */
    flex-shrink: 0;
    text-align: center;
    padding: 15px 0;
}

/* 标题区域 */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    flex-shrink: 0; /* 防止被压缩 */
}

.main-title {
    font-size: 2rem; /* 降低字体大小 */
    color: #ff6b9d;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from { text-shadow: 2px 2px 4px rgba(0,0,0,0.1), 0 0 10px rgba(255, 107, 157, 0.3); }
    to { text-shadow: 2px 2px 4px rgba(0,0,0,0.1), 0 0 20px rgba(255, 107, 157, 0.6); }
}

.cat-emoji {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 300;
}

/* 视频区域 */
.video-section {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    flex: 1; /* 占据剩余空间 */
    min-height: 0; /* 允许收缩 */
    display: flex;
    flex-direction: column;
}

/* 控制按钮始终保持水平排列 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
    flex-direction: row !important; /* 强制水平排列 */
}

/* 视频播放区域包装 */
.video-area {
    display: flex;
    flex-direction: column;
}

/* 互动区域包装 */
.interaction-area {
    display: flex;
    flex-direction: column;
}

/* 横屏布局（默认） */
.video-section.landscape {
    flex-direction: column;
}

.video-section.landscape .video-area {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.video-section.landscape .interaction-area {
    flex-shrink: 0;
}

/* 竖屏布局 */
.video-section.portrait {
    flex-direction: row;
    align-items: stretch;
}

.video-section.portrait .video-area {
    flex: 1;
    height: 100%;
    max-width: 60%;
    display: flex;
    flex-direction: column;
}

.video-section.portrait .interaction-area {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 20px;
}

.video-container {
    position: relative;
    width: 100%;
    height: 50vh; /* 固定高度 */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #ffcce6 0%, #ccf2ff 50%, #e6ccff 100%); /* 背景填充 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container:hover {
    transform: scale(1.02);
}

/* 移动端竖屏模式调整 */
@media screen and (max-width: 768px) {
    .video-section.portrait .video-container {
        max-width: 100%;
        height: 40vh;
        max-height: 50vh;
    }
}

#mainVideo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    border-radius: 15px;
    object-fit: contain;
}

/* 播放覆盖层 */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-button {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 40px;
    border-radius: 50px;
    text-align: center;
    transition: all 0.3s ease;
}

.play-button:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.play-icon {
    font-size: 2rem;
    color: #ff6b9d;
    display: block;
    margin-bottom: 5px;
}

.play-text {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.control-btn {
    background: linear-gradient(45deg, #ff9ec5, #ffb6d9);
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(255, 107, 157, 0.3);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 107, 157, 0.4);
    background: linear-gradient(45deg, #ff7bac, #ff9ec5);
}

.control-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.2rem;
}

/* 猫咪互动区 */
.cat-interaction {
    background: rgba(255, 240, 245, 0.8);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    flex-shrink: 0; /* 防止被压缩 */
}

#catCharacter {
    width: 120px;
    height: 100px;
    margin: 0 auto 25px;
    position: relative;
    transition: all 0.3s ease;
}

.cat-head {
    width: 80px;
    height: 70px;
    background: #ffcc99;
    border-radius: 50% 50% 40% 40%;
    position: relative;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cat-ear {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 25px solid #ff9966;
    position: absolute;
    top: -15px;
}

.left-ear { left: 5px; transform: rotate(-15deg); }
.right-ear { right: 5px; transform: rotate(15deg); }

.cat-eye {
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    position: absolute;
    top: 25px;
    animation: blink 4s infinite;
}

.left-eye { left: 20px; }
.right-eye { right: 20px; }

@keyframes blink {
    0%, 95%, 100% { height: 12px; }
    97.5% { height: 2px; }
}

.cat-nose {
    width: 8px;
    height: 6px;
    background: #ff6666;
    border-radius: 50%;
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
}

.cat-mouth {
    width: 20px;
    height: 10px;
    border-bottom: 2px solid #ff6666;
    border-radius: 0 0 50% 50%;
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
}

.cat-body {
    width: 60px;
    height: 40px;
    background: #ffcc99;
    border-radius: 40% 40% 50% 50%;
    margin: -10px auto 0;
    position: relative;
}

.cat-tail {
    width: 8px;
    height: 30px;
    background: #ff9966;
    position: absolute;
    right: -5px;
    top: 10px;
    border-radius: 4px;
    transform-origin: top center;
    animation: tailWag 2s infinite ease-in-out;
}

@keyframes tailWag {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
}

/* 互动按钮 */
.interaction-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.interaction-btn {
    background: white;
    border: 2px solid #ffb6c1;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff6b9d;
    font-weight: 500;
}

.interaction-btn:hover {
    background: #ffb6c1;
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 182, 193, 0.4);
}

.interaction-btn:active {
    transform: translateY(-2px);
}

/* 返回首页按钮 */
.back-home {
    text-align: center;
}

.home-btn {
    display: inline-block;
    background: linear-gradient(45deg, #66ccff, #99ddff);
    color: white;
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 204, 255, 0.3);
}

.home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 204, 255, 0.4);
    background: linear-gradient(45deg, #4db8ff, #66ccff);
}

.home-icon {
    margin-right: 8px;
}

/* 移动端适配优化 */
@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
        height: calc(100vh - 20px);
    }

    .header {
        padding: 10px;
        margin-bottom: 15px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .video-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .video-container {
        height: 45vh;
    }

    .controls {
        margin-top: 15px;
        gap: 10px;
    }

    .control-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .cat-interaction {
        padding: 15px;
        margin-bottom: 15px;
    }

    .interaction-buttons {
        gap: 12px;
    }

    .interaction-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .back-home {
        padding: 10px 0;
    }

    .home-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }

    /* 竖屏布局移动端优化 */
    .video-section.portrait {
        flex-direction: column;
    }

    .video-section.portrait .video-area {
        max-width: 100%;
        height: auto;
    }

    .video-section.portrait .interaction-area {
        padding-left: 0;
        padding-top: 15px;
    }

    .video-section.portrait .controls {
        margin-top: 15px;
    }

    .floating-cat {
        font-size: 1.5rem;
    }

    .heart {
        font-size: 1.2rem;
    }
}

/* 小屏幕设备进一步优化 */
@media screen and (max-width: 480px) {
    .container {
        padding: 5px;
        height: calc(100vh - 10px);
    }

    .header {
        padding: 8px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .video-section {
        padding: 12px;
    }

    .video-container {
        height: 40vh;
    }

    .controls {
        gap: 8px;
    }

    .control-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .cat-interaction {
        padding: 12px;
    }

    .interaction-buttons {
        gap: 8px;
    }

    .interaction-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    .home-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}
