/* 主要布局样式 */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}



/* 主体区域 */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 消息列表区域 */
.message-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

.message-list::-webkit-scrollbar {
    width: 6px;
}

.message-list::-webkit-scrollbar-track {
    background: transparent;
}

.message-list::-webkit-scrollbar-thumb {
    background: rgba(7, 193, 96, 0.3);
    border-radius: 3px;
}

.message-list::-webkit-scrollbar-thumb:hover {
    background: rgba(7, 193, 96, 0.5);
}

/* 输入区域 - 微信移动端风格 */
.input-container {
    border-top: 1px solid #e7e7e7;
    padding: 8px 12px;
    background-color: #f7f7f7;
    position: sticky;
    bottom: 0;
    z-index: 100;
    min-height: 56px;
    display: flex;
    align-items: center;
}



/* 加载和空状态 */
.loading {
    text-align: center;
    color: #07c160;
    padding: 3rem 2rem;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.6;
    background: linear-gradient(135deg, #07c160, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(7, 193, 96, 0.2));
}

.empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes float {
    from {
        transform: translateX(-100px);
    }
    to {
        transform: translateX(calc(100vw + 100px));
    }
}

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

.fade-in {
    animation: fadeIn 0.1s ease-out;
}

/* 优化消息列表性能 */
.message-list {
    will-change: scroll-position;
    contain: layout style paint;
}

.message {
    will-change: transform, opacity;
    contain: layout style paint;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}
