/* 全局样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
}


/* 通用卡片样式 */

.card {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    padding: 40px 30px;
    width: 100%;
    margin: 20px auto;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}


/* 标题样式 */

.title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}


/* 表单组样式 */

.form-group {
    position: relative;
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 16px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: rgba(255, 255, 255, 0.8);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}


/* 按钮通用样式 */

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    width: 100%;
}

.btn:hover {
    background: linear-gradient(135deg, #5a6edf 0%, #6a3fa0 100%);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}


/* 错误信息样式 */

.error-message {
    color: #ff4444;
    font-size: 14px;
    display: block;
    margin-top: 5px;
}


/* 链接样式 */

.link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.link:hover {
    color: #5a6edf;
    text-decoration: underline;
}


/* 登录页面样式 */

.login-container {
    max-width: 420px;
    margin: auto;
}


/* 注册页面样式 */

.register-container {
    max-width: 420px;
    margin: auto;
}


/* 登录/注册页面头部样式 */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4a6bff;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px auto;
    max-width: 1200px;
}

.page-title {
    font-size: 24px;
}


/* 主页样式 */

.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #4a6bff;
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
    margin-right: 15px;
}

.page-title {
    font-size: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar-link {
    display: block;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.main-content {
    background-color: white;
    border-radius: 0 0 10px 10px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post {
    background-color: white;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
    margin-right: 10px;
}

.post-avatar.anonymous {
    background-color: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.post-author-info {
    flex: 1;
}

.post-author {
    font-weight: bold;
    display: block;
}

.post-time {
    color: #999;
    font-size: 14px;
    display: block;
}

.post-content-text {
    margin-bottom: 15px;
}

.post-image {
    max-width: 80%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.post-actions {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.post-action {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    cursor: pointer;
}

.post-action:hover {
    color: #4a6bff;
}

.delete-post {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.delete-post:hover {
    background-color: #ff1a1a;
}


/* 个人主页样式 */

.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.profile-details {
    flex: 1;
}

.my-posts-title {
    font-size: 20px;
    margin-bottom: 15px;
}


/* 模态框样式 */

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.logout-button {
    display: inline-block;
    background-color: #ff4444;
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: background-color 0.3s;
}

.logout-button:hover {
    background-color: #cc0000;
}


/* 页脚样式 */

.site-footer {
    background-color: #f8f9fa;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #6c757d;
}

.site-footer a {
    color: #007bff;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer img {
    vertical-align: middle;
    margin-right: 5px;
    width: 16px;
    height: 16px;
}