/* 赛博朋克渐变背景动画 */
@keyframes neonBackground {
    0% { background: #0a0a0a; }
    25% { background: #120a1c; }
    50% { background: #1a0033; }
    75% { background: #120a1c; }
    100% { background: #0a0a0a; }
}

/* 应用渐变背景 */
body {
    background: linear-gradient(45deg, #1a0033, #120a1c, #0a0a0a);
    background-size: 400% 400%;
    animation: neonBackground 8s infinite alternate;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    color: white;
    font-family: 'Orbitron', sans-serif;
    text-align: center;
}

/* LOGO */
.logo {
    width: 200px;
    height: auto;
    margin-bottom: 20px;
}

/* 霓虹标题 */
h1 {
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 3px;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
    margin-bottom: 10px;
}

/* 输入框 */
input {
    width: 300px;
    height: 40px;
    font-size: 18px;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid cyan;
    background-color: black;
    color: white;
    text-align: center;
}

#chatInput::placeholder {
    color: #00ffff;
    opacity: 0.6;
}

/* 赛博朋克风聊天框 */
#chatBox {
    width: 80%;
    max-width: 600px;
    height: 300px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
    border-radius: 10px;
    padding: 15px;
    margin: 20px auto;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 0 5px #ff00ff;
}

/* 按钮样式 */
button {
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: transparent;
    color: cyan;
    border: 2px solid cyan;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 0 15px cyan, 0 0 30px rgba(0, 255, 255, 0.5);
}

button:hover {
    background-color: cyan;
    color: black;
    box-shadow: 0 0 25px cyan, 0 0 50px rgba(0, 255, 255, 0.7);
}

/* 让返回主页按钮更低一点 */
#backButton {
    margin-top: 30px;
    display: block;
    text-align: center;
}
/* 用户消息 */
.userMessage {
    align-self: flex-end;
    color: #ff66ff;
    background: #ff66ff33;
    border-left: 3px solid #ff66ff;
    padding: 8px;
    text-align: right;
    animation: fadeInRight 0.5s ease-out;
    border-radius: 15px 15px 0px 15px;
}

/* AI 消息 */
.aiMessage {
    align-self: flex-start;
    color: #00ffff;
    background: #00ffff33;
    border-left: 3px solid #00ffff;
    padding: 8px;
    text-align: left;
    animation: fadeInLeft 0.5s ease-out;
    border-radius: 15px 15px 15px 0px;
}

/* 消息泡泡效果 */
.userMessage::before {
    content: "";
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #ff66ff ;
}

.aiMessage::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent #00ffff;
    border-color: transparent #00ffff transparent transparent;
}

/* 淡入动画 */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 让聊天框支持滚动 */
.chat-box {
    max-height: 300px;
    overflow-y: auto;
}