/* 选择题背景图 */

.question-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2;
}

.question-bg {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(.4, 0, .2, 1);
}

.question-bg.visible {
    opacity: 1;
}

.question-bg.fade-out {
    opacity: 0 !important;
}

.question-container {
    z-index: 3;
}

.option-icon img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

@font-face {
    font-family: 'Handwriting';
    src: url('asset/handwriting.ttf') format('truetype');
    font-display: swap;
}


/* CSS变量定义 */

:root {
    --question-fade-in: 1.2s;
    --question-fade-out: 1.2s;
    --proposal-fade-in: 1.2s;
    --proposal-fade-out: 1.2s;
    --proposal-font-size: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background-color: #000;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* 安全区域支持 */

@supports (padding: max(0px)) {
    #app {
        padding-left: max(env(safe-area-inset-left), 20px);
        padding-right: max(env(safe-area-inset-right), 20px);
        padding-top: max(env(safe-area-inset-top), 20px);
        padding-bottom: max(env(safe-area-inset-bottom), 20px);
    }
}


/* 通用文字样式 */

.text-content {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-font-size, 18px);
    line-height: 1.6;
    text-align: center;
    color: #fff;
    max-width: 80vw;
    word-wrap: break-word;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.text-content.fade-in {
    opacity: 1;
}

.text-content.fade-out {
    opacity: 0;
}


/* 欢迎页文字样式 */

.welcome-text {
    font-size: var(--title-font-size, 20px);
    margin-bottom: 20px;
}


/* 问题页样式 */

.question-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
    transition: opacity var(--question-fade-in) ease-in-out;
    opacity: 0;
}

.question-container.fade-in {
    opacity: 1;
}

.question-container.fade-out {
    opacity: 0;
}

.question-text {
    font-size: var(--question-font-size, 20px);
    margin-bottom: 40px;
    max-width: 85vw;
    text-align: center;
    line-height: 1.5;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #f7f7fa;
    border: none;
    border-radius: 16px;
    box-shadow: 0 2px 8px 0 rgba(60, 60, 67, 0.06);
    padding: 16px 24px;
    color: #222;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 17px;
    cursor: pointer;
    transition: box-shadow 0.2s, background 0.2s, transform 0.1s;
    outline: none;
    border-bottom: 2px solid #e5e5ea;
    user-select: none;
}

.option-btn:hover,
.option-btn:focus {
    background: #e5e5ea;
    box-shadow: 0 4px 16px 0 rgba(60, 60, 67, 0.10);
    transform: translateY(-2px);
}

.option-btn:active {
    background: #d1d1d6;
    transform: scale(0.97);
}

.option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    text-align: left;
    font-size: var(--option-font-size, 17px);
    color: #222;
    font-weight: 500;
    letter-spacing: 0.01em;
}


/* 视频背景 */

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}


/* 视频黑色蒙版（覆盖在视频之上） */

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 5;
    pointer-events: none;
}

.video-overlay.to-half {
    background: rgba(0, 0, 0, 0);
}


/* 黑色蒙版 */

.black-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    transition: opacity 1s ease-in-out;
}

.black-mask.fade-out {
    opacity: 0;
}

.black-mask.fade-in {
    opacity: 1;
}


/* 求婚页样式 */

.proposal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.proposal-text {
    font-size: var(--proposal-font-size);
    margin-bottom: 30px;
    max-width: 80vw;
    line-height: 1.6;
    font-family: 'Handwriting', serif;
    /* 第5幕使用手写体字体 */
    opacity: 0;
    transition: opacity var(--proposal-fade-in) ease-in-out;
}

.proposal-text.fade-in {
    opacity: 1;
}

.proposal-text.fade-out {
    opacity: 0;
}


/* 加载状态 */

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}


/* 响应式设计 */

@media (max-width: 768px) {
    .text-content {
        font-size: calc(var(--text-font-size, 18px) * 1.3);
        max-width: 90vw;
    }
    .question-text {
        font-size: calc(var(--question-font-size, 20px) * 1.2);
        max-width: 90vw;
    }
    .option-btn {
        font-size: calc(var(--option-font-size, 17px) * 1.1);
        padding: 12px 16px;
    }
    .proposal-text {
        font-size: calc(var(--proposal-font-size, 48px) * 0.875);
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    .text-content {
        font-size: calc(var(--text-font-size, 18px) * 1.3);
    }
    .question-text {
        font-size: calc(var(--question-font-size, 20px) * 1.2);
    }
    .option-btn {
        font-size: calc(var(--option-font-size, 17px) * 1.1);
        padding: 10px 14px;
    }
    .proposal-text {
        font-size: calc(var(--proposal-font-size, 48px) * 0.575);
    }
}


/* 防止用户选择文字 */

#app {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}