@font-face {
    font-family: 'ChillPixels-Matrix';
    src: url('../assets/fonts/ChillPixels-Matrix.woff2') format('woff2'),
         url('../assets/fonts/ChillPixels-Matrix.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AaHuanMengKongJian';
    src: url('../assets/fonts/AaHuanMengKongJian.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

body, button, input {
    font-family: 'ChillPixels-Matrix', 'AaHuanMengKongJian', sans-serif;
}

body {
    background: linear-gradient(180deg, #4F2100 0%, #371700 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 主容器样式 */
.app-container {
    width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 主内容区域样式 */
.main-content {
    display: flex;
    margin-bottom: 20px;
}

/* 场景区域样式 */
.scene-container {
    position: relative;
    width: 560px;
    height: 350px;
    border-radius: 20px;
    border: 10px solid #2F1400;
    overflow: hidden;
}

.video-container {
    width: 100%;
    height: 100%;
    background-color: #783200; /* 未加载时的背景色 */
}

#scene-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 聊天气泡容器 */
#chat-bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 聊天气泡样式 */
.chat-bubble {
    position: absolute;
    padding: 15px 19px;
    background: #FFFFFF;
    border-radius: 20px;
    box-sizing: border-box;
    border: 4px solid #000000;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
    max-width: 100%;
    font-size: 20px;
    color: #000000;
    animation: fadeIn 0.5s ease-in-out, fadeOut 0.5s ease-in-out 4.5s forwards;
    word-wrap: break-word;
}

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

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: typing 2s steps(40, end);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* 控制区域样式 */
.controls-container {
    width: 200px;
    padding-left: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section {
    width: 100%;
}

/* 按钮通用样式 */
button {
    cursor: pointer;
    transition: transform 0.2s ease;
    padding-bottom: 6px;
}

button:hover {
    transform: scale(1.05);
}

/* START 按钮样式 */
#start-button {
    width:160px;
    height: 57px;
    border-radius: 20px;
    background: #FF6A00;
    box-sizing: border-box;
    border: 4px solid #000000;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
    font-size: 40px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding-bottom: 8px;
}

#start-button.focus-mode {
    background: #502B11;
    color: rgba(255, 255, 255, 0.5);
}

/* 时间控制器样式 */
.time-control {
    display: flex;
    margin-bottom: 65px;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#timer-display {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

#timer-slider {
    width: 100%;
    height: 10px;
    appearance: none;
    background: #2C1402;
    border-radius: 5px;
    outline: none;
}

#timer-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
}

#cancel-button {
    font-size: 20px;
    color: #000000;
    background: none;
    border: none;
    cursor: pointer;
}

/* SCENE 和 SETTING 按钮样式 */
#scene-button, #setting-button {
    width: 160px;
    height: 57px;
    border-radius: 20px;
    background: #CD773A;
    box-sizing: border-box;
    border: 4px solid #000000;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
    font-size: 30px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 底部聊天输入区域 */
.chat-input-container {
    width: 760px;
    height: 57px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    border-radius: 20px;
    background: #7C4C2A;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
}

#chat-input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0 20px;
    font-size: 20px;
    color: #3C1900;
    outline: none;
}

#chat-input::placeholder {
    color: rgba(60, 25, 0, 0.5);
    font-size: 20px;
}

#send-button {
    position: absolute;
    right: 10px;
    width: 92px;
    height: 36px;
    border-radius: 20px;
    background: #CD773A;
    border: 4px solid #000000;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
    font-size: 20px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 4px;
}

#send-button.loading {
    background: #CD773A;
    color: transparent;
    position: relative;
}

#send-button.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 底部署名 */
.footer {
    font-size: 16px;
    color: #874314;
    margin-top: 10px;
}

/* 模态框通用样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    border-radius: 50px;
    box-sizing: border-box;
    border: 4px solid #000000;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
    background: #CD773A;
    padding: 30px;
    position: relative;
    animation: modal-fade-in 0.4s cubic-bezier(.22,1.15,.5,1.01);
    opacity: 1;
    transform: scale(1);
}

.modal.hide-anim .modal-content {
    animation: modal-fade-out 0.3s cubic-bezier(.55,0,.55,1);
}

@keyframes modal-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    80% {
        opacity: 1;
        transform: scale(1.04);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modal-fade-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 场景选择模态框 */
.scene-modal-content {
    width: 656px;
    height: 414px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.scene-modal-content h2 {
    font-size: 30px;
    margin-bottom: 30px;
}

.scene-options {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-bottom: 30px;
}

.scene-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.scene-option:hover {
    transform: scale(1.05);
}

.scene-preview {
    width: 160px;
    height: 180px;
    border-radius: 20px;
    margin-bottom: 15px;
    border: 4px solid #000000;
    overflow: hidden;
    background-color: #783200; /* 未加载时的背景色 */
}

.scene-option p {
    font-size: 26px;
    padding-bottom: 5px;
}

.scene-option.active {
    position: relative;
}

.scene-option.active::after {
    content: '';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background-color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-option.active::before {
    content: '✓';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    color: #CD773A;
    font-size: 20px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 设置模态框 */
.settings-modal-content {
    width: 656px;
    padding: 40px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.setting-label {
    font-size: 30px;
    padding-bottom: 5px;
}

#volume-slider {
    width: 300px;
    height: 10px;
    appearance: none;
    background: #2C1402;
    border-radius: 5px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #000000;
    cursor: pointer;
}

.toggle-container {
    position: relative;
    width: 60px;
    height: 34px;
}

#motion-toggle {
    opacity: 0;
    width: 0;
    height: 0;
}

#motion-toggle + label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2C1402;
    border-radius: 34px;
    transition: .4s;
}

#motion-toggle + label:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #000;
    border-radius: 50%;
    transition: .4s;
}

#motion-toggle:checked + label {
    background-color: #FF6A00;
}

#motion-toggle:checked + label:before {
    transform: translateX(26px);
}

/* 通用关闭按钮 */
.close-button {
    width: 200px;
    height: 57px;
    border-radius: 20px;
    background: #FF6A00;
    box-sizing: border-box;
    border: 4px solid #000000;
    box-shadow: 0px 9px 0px -4px rgba(30, 13, 0, 0.5);
    font-size: 30px;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto 0 auto;
    cursor: pointer;
    padding-bottom: 6px;
}

/* 通用隐藏类 */
.hidden {
    display: none !important;
}

/* 场景预览特定样式 */
.rain-preview {
    background-image: url('../assets/images/rain_preview.png');
    background-size: cover;
}

.snow-preview {
    background-image: url('../assets/images/snow_preview.png');
    background-size: cover;
}

.seaside-preview {
    background-image: url('../assets/images/seaside_preview.png');
    background-size: cover;
}

/* 视频切换动画 */
.video-fade-in {
    animation: video-fade-in 0.4s ease-in-out forwards;
}

.video-fade-out {
    animation: video-fade-out 0.4s ease-in-out forwards;
}

@keyframes video-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes video-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
} 