/* 朋友圈页面样式 */
body {
    font-family: "Microsoft Yahei", sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

header {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
}

nav {
    background-color: #4CAF50;
    padding: 0;
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

nav li {
    flex: 1;
    min-width: 100px;
}

nav a {
    display: block;
    color: white;
    text-align: center;
    padding: 14px 20px;
    text-decoration: none;
    transition: background-color 0.3s;
}

nav a:hover, nav a.active {
    background-color: #388E3C;
}

/* 用户信息区域 */
.user-info {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info #user-name {
    font-weight: bold;
}

.user-info #logout-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.user-info #logout-btn:hover {
    background-color: #d32f2f;
}

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

section {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h2 {
    color: #333;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    margin-top: 0;
}

/* 认证页面样式 */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #4CAF50;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    box-sizing: border-box;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-container canvas {
    border: 1px solid #4CAF50;
    border-radius: 4px;
}

.captcha-container button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
}

.captcha-container button:hover {
    background-color: #388E3C;
}

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

.auth-container button:hover {
    background-color: #388E3C;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: #4CAF50;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 蓝色主题认证页面样式 */
.blue-theme {
    background-color: #2196F3;
}

.blue-theme header {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.blue-theme nav {
    background-color: #2196F3;
}

.blue-theme nav a:hover, 
.blue-theme nav a.active {
    background-color: #1976D2;
}

.blue-theme .form-group label {
    color: #2196F3;
}

.blue-theme .form-group input {
    border: 1px solid #2196F3;
}

.blue-theme .captcha-container canvas {
    border: 1px solid #2196F3;
}

.blue-theme .captcha-container button {
    background-color: #2196F3;
}

.blue-theme .captcha-container button:hover {
    background-color: #1976D2;
}

.blue-theme .auth-container button {
    background-color: #2196F3;
}

.blue-theme .auth-container button:hover {
    background-color: #1976D2;
}

.blue-theme .auth-footer a {
    color: #2196F3;
}

/* 朋友圈动态样式 */
.moments-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.moment-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.moment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.moment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 10px;
}

.moment-user-info {
    flex: 1;
}

.moment-username {
    font-weight: bold;
    color: #333;
}

.moment-time {
    font-size: 12px;
    color: #999;
}

.moment-content {
    margin-bottom: 15px;
}

.moment-content p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.moment-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.moment-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.moment-videos {
    margin-bottom: 10px;
}

.moment-video {
    width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

.moment-actions {
    display: flex;
    gap: 15px;
}

.moment-actions button {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
}

.moment-actions button:hover {
    color: #4CAF50;
    background-color: #f5f5f5;
    border-radius: 4px;
}

/* 聊天样式 */
.chat-container {
    display: flex;
    height: 600px;
    gap: 20px;
}

.contact-list {
    flex: 1;
    max-width: 250px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    overflow-y: auto;
}

.contact-list h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.contacts, .group-chats {
    margin-bottom: 20px;
}

.contact, .group-chat {
    display: flex;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
}

.contact:hover, .group-chat:hover {
    background-color: #f5f5f5;
}

.contact.active, .group-chat.active {
    background-color: #e8f5e9;
}

.contact-avatar, .group-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 10px;
}

.contact-name, .group-name {
    flex: 1;
    font-size: 14px;
}

#create-group-btn {
    width: 100%;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
}

#create-group-btn:hover {
    background-color: #388E3C;
}

.chat-window {
    flex: 3;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.chat-header {
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #fafafa;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
}

.message.sent .message-content {
    background-color: #4CAF50;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received .message-content {
    background-color: #e0e0e0;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-text {
    word-break: break-word;
    line-height: 1.4;
}

.message-image, .message-video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

.message-file {
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-voice audio {
    width: 200px;
}

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

.message.sent .message-time {
    text-align: right;
}

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

.input-tools {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-tools button {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
}

.input-tools button:hover {
    background-color: #e0e0e0;
}

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

#message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    height: 60px;
}

#send-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    align-self: flex-end;
}

#send-btn:hover {
    background-color: #388E3C;
}

/* 发表说说样式 */
.publish-container {
    max-width: 600px;
    margin: 0 auto;
}

.publish-container .form-group {
    margin-bottom: 20px;
}

.publish-container .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.publish-container .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    height: 100px;
    box-sizing: border-box;
}

.option {
    margin-bottom: 10px;
}

.option label {
    display: block;
    margin-bottom: 5px;
}

.option input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.preview-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview {
    position: relative;
    width: 100px;
    height: 100px;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

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

.publish-container button:hover {
    background-color: #388E3C;
}

/* 好友管理样式 */
.search-friends {
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

.search-form button:hover {
    background-color: #388E3C;
}

.search-result {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.add-friend-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.add-friend-btn:hover {
    background-color: #388E3C;
}

.friend-list h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.friends {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.friend-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #fafafa;
}

.friend-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 15px;
}

.friend-info {
    flex: 1;
}

.friend-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.friend-phone {
    font-size: 14px;
    color: #666;
}

.remove-friend-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
}

.remove-friend-btn:hover {
    background-color: #d32f2f;
}

/* 群聊样式 */
.group-chat-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.group-chat-section h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.group-members-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.member-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.member-checkbox input {
    margin-right: 10px;
}

/* 模态框样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #f44336;
}

.emoji-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.emoji {
    font-size: 24px;
    text-align: center;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
}

.emoji:hover {
    background-color: #f5f5f5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
        height: auto;
    }
    
    .contact-list {
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav li {
        min-width: 100%;
    }
    
    .user-info {
        position: static;
        margin-top: 10px;
        justify-content: center;
    }
}