/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
    user-select: none; /* 全局禁止文字选择 */
}

body {
    background-image: url('images/bg1.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 20px;
    transition: background-image 1s ease-in-out;
}

body.bg2 {
    background-image: url('images/bg2.png');
}

body.bg3 {
    background-image: url('images/bg3.png');
}

.container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 毛玻璃效果 */
.glass {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
}

/* 头部样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* 聊天容器样式 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
    min-height: 500px;
    position: relative;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* 消息样式 */
.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
    word-break: break-word;
    user-select: text; /* 允许选择消息文本 */
}

.user-message {
    align-self: flex-end;
    background-color: rgba(66, 135, 245, 0.6);
    border: 1px solid rgba(66, 135, 245, 0.8);
}

.ai-message {
    align-self: flex-start;
    background-color: rgba(70, 70, 70, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-message.yes {
    border: 2px solid rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.ai-message.no {
    border: 2px solid rgba(255, 0, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.ai-message.maybe {
    border: 2px solid rgba(255, 255, 0, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.ai-message.error {
    background-color: rgba(70, 70, 70, 0.3);
    color: #ff5555;
}

/* 打字机效果 */
.typing {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    margin: 0;
    width: 0;
    animation: typing 1s steps(30, end) forwards;
}

/* 加载动画 */
.loading-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    height: 20px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite ease-in-out;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* 游戏信息 */
.game-info {
    display: flex;
    justify-content: space-between;
    padding: 0 20px 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* 聊天控制区 */
.chat-controls {
    display: flex;
    gap: 10px;
    padding: 0 20px 10px;
}

.give-up-btn {
    background-color: rgba(255, 59, 48, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.give-up-btn:hover {
    background-color: rgba(255, 59, 48, 0.9);
    transform: translateY(-2px);
}

.give-up-btn:disabled {
    background-color: rgba(150, 150, 150, 0.5);
    cursor: not-allowed;
    transform: none;
}

.input-container {
    display: flex;
    flex: 1;
    gap: 10px;
}

#userInput {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

#userInput:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

#userInput:disabled {
    background-color: rgba(150, 150, 150, 0.2);
    cursor: not-allowed;
}

#sendBtn {
    background-color: rgba(66, 135, 245, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#sendBtn:hover:not(:disabled) {
    background-color: rgba(66, 135, 245, 0.9);
    transform: translateY(-2px);
}

#sendBtn:disabled {
    background-color: rgba(150, 150, 150, 0.5);
    cursor: not-allowed;
}

/* 游戏控制区 */
.game-controls {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.start-btn, .restart-btn {
    background-color: rgba(52, 199, 89, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn:hover, .restart-btn:hover {
    background-color: rgba(52, 199, 89, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-controls {
        flex-direction: column;
    }
    
    .give-up-btn {
        align-self: flex-start;
    }
}

/* 确认框样式 */
.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 25px;
    z-index: 1000;
    max-width: 350px;
    width: 90%;
    display: none;
    animation: fadeIn 0.3s ease;
}

.confirm-dialog.show {
    display: block;
}

.confirm-title {
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    color: #fff;
}

.confirm-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 15px;
}

.confirm-yes {
    background-color: rgba(255, 59, 48, 0.7);
    color: white;
}

.confirm-yes:hover {
    background-color: rgba(255, 59, 48, 0.9);
}

.confirm-no {
    background-color: rgba(150, 150, 150, 0.4);
    color: white;
}

.confirm-no:hover {
    background-color: rgba(150, 150, 150, 0.6);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.overlay.show {
    display: block;
} 