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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* 主内容区样式 */
.main-content {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
}

.main-content.blurred {
    filter: blur(10px);
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 1px;
}

/* 用户状态信息 */
#user-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn {
    background: none;
    border: none;
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

/* 输入区域样式 */
.input-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#message-input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 15px;
    background: #F5F5F7;
    transition: all 0.3s ease;
}

#message-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: white;
}

#send-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#send-btn:active {
    transform: translateY(0);
}

#send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 留言展示区域 */
.messages-section {
    margin-top: 20px;
}

#messages-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.message-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.message-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 新消息卡片动画 */
.message-card.new-message {
    animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
}

/* 留言卡片内容 */
.message-author {
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-author::before {
    content: '👤';
    font-size: 1rem;
}

.message-content {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
    word-wrap: break-word;
}

.message-time {
    font-size: 0.85rem;
    color: #999;
    text-align: right;
}

/* 中央登录卡片 */
.auth-card {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-card.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
}

.auth-card-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.auth-card-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.auth-card-subtitle {
    font-size: 1rem;
    color: #999;
    margin-bottom: 30px;
}

/* 认证表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    background: #F5F5F7;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* 认证按钮 */
.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 10px;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.auth-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        margin-bottom: 30px;
        padding: 30px 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    #messages-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .message-card {
        padding: 15px;
    }
    
    .auth-card-content {
        padding: 30px 20px;
    }
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}