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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

/* 入场动画容器 */
.intro-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    outline: none;
    pointer-events: none;
}

/* 隐藏视频控制条 */
.intro-video::-webkit-media-controls {
    display: none !important;
}

.intro-video::-webkit-media-controls-enclosure {
    display: none !important;
}

.intro-video::-webkit-media-controls-panel {
    display: none !important;
}

.intro-video::-webkit-media-controls-play-button {
    display: none !important;
}

.intro-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* 隐藏所有媒体控制元素 */
.intro-video::-webkit-media-controls-timeline,
.intro-video::-webkit-media-controls-current-time-display,
.intro-video::-webkit-media-controls-time-remaining-display,
.intro-video::-webkit-media-controls-mute-button,
.intro-video::-webkit-media-controls-volume-slider,
.intro-video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

/* 减淡出场动画 */
.intro-video-container.fade-out {
    animation: fadeOut 1s ease-out forwards;
}

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

/* 主内容容器 */
.main-content {
    opacity: 0;
    transition: opacity 1s ease-in;
}

.main-content.show {
    opacity: 1;
}

/* 背景图 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/scene_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* 人物容器 */
.character {
    position: fixed;
    z-index: 1;
    height: 100vh;
    display: flex;
    align-items: flex-end;
}

.character-left {
    left: -100px;
    transform: scale(1.05);
}

.character-right {
    right: -140px;
    transform: translateY(10%);
}

.character-base {
    display: block;
    height: 100vh;
    width: auto;
    object-fit: contain;
    object-position: bottom;
}

.character-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100vh;
    width: auto;
    object-fit: contain;
    object-position: bottom;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.character-overlay.active {
    opacity: 1;
}

/* 浮动动画 */
.character {
    animation: float 4s ease-in-out infinite;
}

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

.character-left {
    animation: floatLeft 4s ease-in-out infinite;
}

@keyframes floatLeft {
    0%, 100% {
        transform: translateY(0) scale(1.05);
    }
    50% {
        transform: translateY(-15px) scale(1.05);
    }
}

.character-right {
    animation: floatRight 4s ease-in-out infinite;
}

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

/* 说话动画 */
.character.talking {
    animation: talk 0.5s ease-in-out;
}

@keyframes talk {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.05) translateY(-5px);
    }
}

.character-left.talking {
    animation: talkLeft 0.5s ease-in-out;
}

@keyframes talkLeft {
    0%, 100% {
        transform: scale(1.05) translateY(0);
    }
    50% {
        transform: scale(1.1) translateY(-5px);
    }
}

.character-right.talking {
    animation: talkRight 0.5s ease-in-out;
}

@keyframes talkRight {
    0%, 100% {
        transform: translateY(10%) scale(1) translateY(0);
    }
    50% {
        transform: translateY(10%) scale(1.05) translateY(-5px);
    }
}

/* 开启对话按钮容器 */
.start-dialog-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-in;
}

.start-dialog-container.hide {
    animation: fadeOut 0.5s ease-out forwards;
}

/* 开启对话按钮 */
.start-dialog-btn {
    padding: 20px 50px;
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.start-dialog-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.start-dialog-btn:hover::before {
    width: 300px;
    height: 300px;
}

.start-dialog-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 30px rgba(255, 107, 53, 0.6);
}

.start-dialog-btn:active {
    transform: translateY(-2px) scale(1.02);
}

.btn-text {
    position: relative;
    z-index: 1;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

.btn-icon {
    position: relative;
    z-index: 1;
    font-size: 32px;
    animation: arrowMove 1.5s ease-in-out infinite;
}

@keyframes arrowMove {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(8px);
    }
}

/* 聊天容器 */
.chat-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 760px;
    max-width: 85vw;
    height: 85vh;
    max-height: 860px;
    display: flex;
    flex-direction: column;
    z-index: 10;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in, visibility 0.5s ease-in;
}

.chat-container.show {
    opacity: 1;
    visibility: visible;
}

/* 标题栏 */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in, visibility 0.5s ease-in;
}

.chat-header.show {
    opacity: 1;
    visibility: visible;
}

/* 当聊天容器未显示时，标题栏独立显示在顶部 */
.chat-container:not(.show) .chat-header {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, 0);
    z-index: 50;
}

/* 当聊天容器显示时，标题栏回到容器内 */
.chat-container.show .chat-header {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    z-index: auto;
}

.header-title {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-title-line1 {
    font-size: 42px;
    font-weight: bold;
    color: #333;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    font-family: 'STXingkai', 'STKaiti', 'KaiTi', 'FangSong', 'Microsoft YaHei', serif;
    letter-spacing: 2px;
}

.header-title-line2 {
    font-size: 28px;
    font-weight: 500;
    color: #555;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

/* 消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: transparent;
}

/* 透明滚动条 */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 消息气泡 */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
    animation: messageSlide 0.3s ease-out;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.sunwu {
    align-self: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.message.user .message-avatar {
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.message.sunwu .message-avatar {
    border: 2px solid #FFA500;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message.user .message-content {
    background: rgba(255, 255, 200, 0.8);
    color: #333;
}

.message.sunwu .message-content {
    background: rgba(255, 255, 200, 0.8);
    color: #333;
}

/* 表情包消息 */
.message.emoji .message-content {
    background: transparent !important;
    background-color: transparent !important;
    padding: 8px;
    border: none;
}

.message.emoji img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    display: block;
}

.message.emoji img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 选项按钮区域 */
.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: transparent;
    justify-content: center;
}

.option-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.option-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.option-btn:active {
    transform: translateY(0);
}

.option-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.refresh-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    background: #FF9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.refresh-btn:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.refresh-btn:active {
    transform: translateY(0);
}

.refresh-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* 表情包大图查看模态框 */
.emoji-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.emoji-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.emoji-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.emoji-modal-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    background: transparent !important;
    background-color: transparent !important;
    border: none;
    display: block;
}

.emoji-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.emoji-modal-close:hover {
    transform: scale(1.2);
}

