/* ===== 主页专用样式 ===== */

/* 主页容器基础样式 */
.index-page {
    font-family: var(--spinmatch-font-family);
    line-height: 1.6;
    color: #333;
    background-color: #1a1a1a;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 英雄区域样式 ===== */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.hero-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.hero-video-background {
    z-index: 1;
    opacity: 0;
    transition: opacity 180ms ease-out;
}

/* 视频准备好后显示原有背景画面。 */
.hero-video-background.is-playing {
    opacity: 0.8;
}

/* Show the real decoded first frame without waiting for playback or a fade. */
.hero-video-background.has-frame {
    opacity: 0.8;
    transition: none;
}

/* 声音文字提示位于标题上方，不占用原标题与按钮的位置。 */
.hero-text {
    position: relative;
}

/* 轻量文字提示：只在进入页面或切换声音时短暂出现。 */
.hero-sound-hint {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 1.125rem);
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms ease-out, visibility 0s linear 240ms;
}

.hero-sound-hint.is-visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
    .hero-sound-hint {
        transition: none;
    }
}

/* 视频遮罩层 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(220, 20, 60, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(220, 20, 60, 0.2) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* 英雄内容 */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 2rem;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-text p {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* 英雄按钮 */
.hero-buttons {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 视频底部渐变遮罩 - 从背景色向上渐变 */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--sm-hero-edge-height);
    background: var(--sm-hero-edge-gradient);
    z-index: 3;
    pointer-events: none;
}

/* 首页按钮使用全局样式 */

/* 首页特定：确保认证模态框在最高层级 */
.index-page .auth-modal {
    z-index: 10000 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-text h1 {
        font-size: 2.5rem;
    }
    
    .hero-text p {
        font-size: 1.2rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    /* 响应式按钮样式使用全局定义 */
    
    .hero-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .hero-content {
        padding: 1rem 0.5rem;
    }
}

/* 短屏按内容撑开，避免标题上方的提示被固定导航遮住。 */
@media (max-height: 560px) {
    .hero {
        height: auto;
    }

    .hero-content {
        padding-top: 8.5rem;
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 1025px) and (max-height: 560px) {
    .hero-content {
        padding-top: 10rem;
    }
}

/* A decoded, always-muted real video covers the main decoder handoff. */
.hero-video-bridge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}
.hero-video-bridge.is-visible { opacity: 0.8; }

/* The video hero uses the same action geometry as the shared page hero. */
.hero-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:min(100%,440px); margin:0 auto; gap:16px; }
.hero-buttons > .btn { width:100%; min-width:0; min-height:50px; padding:12px 20px; font-size:16px; line-height:1.2; }
@media(max-width:768px) {
    .hero-content { padding-left:20px; padding-right:20px; }
    .hero-buttons { gap:12px; }
    .hero-buttons > .btn { min-height:48px; padding:12px 10px; font-size:14px; }
}
