/* --- 基础与背景视频 --- */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: #000;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transition: object-position 1s ease-in-out;
}

.overlay-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.title {
    color: white;
    font-size: 3rem;
    text-shadow: 0px 0px 15px rgba(0, 0, 0, 0.8);
    mix-blend-mode: overlay;
    opacity: 0.42;
}

/* --- 交互按钮 --- */
.interaction-zone {
    position: fixed;
    bottom: 30px;
    right: 9px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
    transition: opacity 0.4s ease;
}

.interaction-zone.hidden {
    opacity: 0;
    pointer-events: none;
}

.interaction-zone button {
    padding: 9px 15px;
    font-size: 1.2rem;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    /* 修改：进一步降低不透明度，达到极致的沉浸感 */
    opacity: 0.36; 
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.interaction-zone button:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* --- 聊天窗口 --- */
#chat-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    height: 75%;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    backdrop-filter: blur(15px);
    z-index: 10;
    display: none;
    flex-direction: column;
    padding: 55px 20px 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: all 0.5s ease-in-out; 
    pointer-events: auto;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#chat-window.visible { opacity: 1; }
#chat-window.collapsed { height: 60px; top: 100%; transform: translate(-50%, -80px); opacity: 0.3; backdrop-filter: blur(5px); box-shadow: none; }
#chat-window.collapsed:hover { opacity: 0.9; }
#chat-window.collapsed #chat-messages,
#chat-window.collapsed #chat-input-container { display: none; }

/* --- 关闭与折叠按钮 --- */
#close-chat-button, #toggle-chat-button {
    position: absolute;
    top: 20px;
    z-index: 11;
    background: transparent !important;
    border: none !important;
    width: 32px;
    height: 32px;
    color: white;
    cursor: pointer;
    opacity: 0.6;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: opacity 0.3s, transform 0.3s;
}
#close-chat-button { right: 20px; font-family: Arial, sans-serif; font-size: 2rem; font-weight: normal; line-height: 1; }
#toggle-chat-button { right: 60px; font-size: 1.2rem; }
#close-chat-button:hover { opacity: 1; transform: rotate(90deg); }
#toggle-chat-button:hover { opacity: 1; transform: scale(1.1); }

/* --- 消息显示区域 --- */
#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 10px;
}

.message { padding: 10px 15px; border-radius: 18px; max-width: 85%; word-wrap: break-word; line-height: 1.5; }
.user-message { background-color: #0078d4; color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.arelia-message { background-color: #3a3a3b; color: #f1f1f1; align-self: flex-start; border-bottom-left-radius: 4px; }

/* --- 输入区域 --- */
#chat-input-container {
    display: flex;
    /* 修改：微调间距，增加和谐感 */
    gap: 8px; 
    flex-shrink: 0;
    align-items: center;
}

#chat-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    /* 新增：确保输入框在Flexbox中可以被正确压缩 */
    min-width: 0;
}

#chat-input::placeholder { color: rgba(255, 255, 255, 0.5); }
#chat-input:focus { outline: none; border-color: #00aaff; box-shadow: 0 0 8px rgba(0, 170, 255, 0.5); }

#send-button {
    flex-shrink: 0;
    /* 修改：微调尺寸，增加空间感 */
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.2rem;
    cursor: pointer;
    background-color: transparent;
    color: white;
    border: none;
    border-radius: 8px;
    transition: background-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#send-button:hover { background-color: rgba(255, 255, 255, 0.2); }
#send-button:active { transform: scale(0.9); }
#send-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- 美化滚动条 --- */
#chat-messages::-webkit-scrollbar { width: 6px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.3); border-radius: 3px; }
#chat-messages::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.5); }
