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

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 密码验证界面 */
#password-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.auth-container input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.auth-container button {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-container button:hover {
    background: #45a049;
}

.hint {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 14px;
}

.message {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
    text-align: center;
}

.message.error {
    background: #ffebee;
    color: #c62828;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

/* 聊天界面 */
#chat-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #4CAF50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info button {
    padding: 5px 15px;
    background: white;
    color: #4CAF50;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
}

.message-item {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 70%;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-item.own {
    background: #4CAF50;
    color: white;
    margin-left: auto;
}

.message-item.other {
    background: white;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message-sender {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 5px;
}

.message-time {
    font-size: 11px;
    opacity: 0.8;
    text-align: right;
    margin-top: 5px;
}

.message-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    margin-top: 5px;
}

.chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #ddd;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.input-group button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#image-preview {
    margin-top: 10px;
}

#image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
    margin-top: 10px;
}
/* 对话框样式 */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.dialog-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    width: 90%;
    max-width: 400px;
}

.dialog-content h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.dialog-content input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.dialog-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.dialog-buttons button:first-child {
    background: #f5f5f5;
    color: #333;
}

.dialog-buttons button:last-child {
    background: #4CAF50;
    color: white;
}