/* 聊天页面样式 */

/* 霍格沃茨大厅背景 */
.hogwarts-hall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=Hogwarts%20Great%20Hall%20interior%2C%20long%20tables%2C%20floating%20candles%2C%20magical%20ceiling%20with%20stars%2C%20detailed%20illustration&image_size=landscape_16_9') no-repeat center/cover;
    filter: brightness(0.7);
    animation: hallLights 15s ease-in-out infinite;
}

@keyframes hallLights {
    0%, 100% {
        filter: brightness(0.7) saturate(1);
    }
    50% {
        filter: brightness(0.8) saturate(1.2);
    }
}

/* 聊天容器 */
.chat-container {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 2rem;
    padding: 2rem;
    min-height: 70vh;
    position: relative;
    z-index: 2;
}

/* 话题侧边栏 */
.topic-sidebar {
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.topic-sidebar h3 {
    color: #FFD700;
    margin-bottom: 1rem;
    text-align: center;
}

.魔法卷轴 {
    background-color: rgba(245, 245, 220, 0.9);
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: scrollFloat 4s ease-in-out infinite;
}

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

.topic-list {
    list-style: none;
}

.topic-item {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-weight: 500;
}

.topic-item:hover {
    background-color: rgba(255, 215, 0, 0.2);
    transform: translateX(5px);
}

.topic-item.active {
    background-color: rgba(255, 215, 0, 0.4);
    font-weight: bold;
}

/* 中央聊天区域 */
.chat-main {
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    overflow: hidden;
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(18, 18, 18, 0.9);
}

.chat-header h2 {
    color: #FFD700;
    font-size: 1.5rem;
}

.online-count {
    color: #F5F5F5;
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: rgba(20, 20, 20, 0.5);
    position: relative;
}

/* 聊天消息 */
.message-item {
    display: flex;
    margin-bottom: 1.5rem;
    animation: messageAppear 0.5s ease-out forwards;
}

@keyframes messageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;
    border: 2px solid #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    max-width: 80%;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.message-username {
    font-weight: bold;
    color: #FFD700;
}

.message-time {
    font-size: 0.8rem;
    color: #999;
}

.message-text {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    border-left: 3px solid #FFD700;
    color: #F5F5F5;
    line-height: 1.4;
}

/* 聊天输入区域 */
.chat-input-area {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    background-color: rgba(18, 18, 18, 0.9);
}

.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.message-input {
    flex: 1;
    padding: 1rem;
    border-radius: 25px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #F5F5F5;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.message-input:focus {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.send-button {
    padding: 0 2rem;
    border-radius: 25px;
    border: none;
    background-color: #FFD700;
    color: #121212;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover {
    background-color: #FFED4E;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    transform: translateY(-2px);
}

.input-tools {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.tool-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 215, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #F5F5F5;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-button:hover {
    border-color: #FFD700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transform: scale(1.1);
}

/* 成员侧边栏 */
.members-sidebar {
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.members-sidebar h3 {
    color: #FFD700;
    margin-bottom: 1rem;
    text-align: center;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.member-item:hover {
    background-color: rgba(255, 215, 0, 0.1);
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;
    position: relative;
    border: 2px solid #FFD700;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4CAF50;
    border: 2px solid #121212;
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.member-name {
    color: #F5F5F5;
    font-size: 0.9rem;
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 10px;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .chat-container {
        grid-template-columns: 200px 1fr 200px;
        gap: 1.5rem;
        padding: 1.5rem;
    }
}

@media (max-width: 992px) {
    .chat-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .topic-sidebar,
    .members-sidebar {
        order: 1;
    }
    
    .chat-main {
        order: 2;
        min-height: 60vh;
    }
    
    .topic-sidebar {
        margin-bottom: 1rem;
    }
    
    .魔法卷轴 {
        display: flex;
        overflow-x: auto;
    }
    
    .topic-list {
        display: flex;
        gap: 0.5rem;
    }
    
    .topic-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
    
    .members-list {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .member-item {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem;
        min-width: 80px;
    }
    
    .member-avatar {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 768px) {
    .chat-header h2 {
        font-size: 1.2rem;
    }
    
    .message-content {
        max-width: 90%;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .send-button {
        padding: 1rem;
    }
}