/* 基本样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 140px);
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #0056b3;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #ff4757;
    color: #fff;
}

.btn-primary:hover {
    background-color: #ff6b81;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5a6268;
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: #ff4757;
    outline: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 14px;
}

/* 头部样式 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: #ff4757;
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #ff4757;
}

.user-avatar {
    display: flex;
    align-items: center;
}

.user-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

/* 移动端悬浮菜单按钮 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: white;
    text-align: center;
    line-height: 60px;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.5);
}

/* 页脚样式 */
.site-footer {
    background-color: #fff;
    border-top: 1px solid #eee;
    padding: 20px 0;
    text-align: center;
    color: #6c757d;
}

/* 警告提示 */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* 表白墙样式 */
.confession-wall {
    text-align: center;
    margin-bottom: 30px;
}

.confession-wall h1 {
    font-size: 36px;
    color: #ff4757;
    margin-bottom: 10px;
}

.confession-wall .subtitle {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 30px;
}

.quick-post {
    margin-bottom: 30px;
}

.posts-container {
    max-width: 95%;
    margin: 0 auto;
}

.post-card {
    width: 100%;;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.post-header {
    padding: 15px;
}

.post-author {
    display: flex;
    align-items: center;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.author-info h3 {
    text-align: left;
    font-size: 18px;
}

.post-time {
    font-size: 14px;
    color: #6c757d;
}

.post-content {
    padding: 20px;
}

.post-content p {
    margin-bottom: 8px;
    font-size: 16px;
    line-height: 1.7;
}

.post-image {
    margin-top: 15px;
}

.post-image img {
    max-width: 100%;
    border-radius: 4px;
}

.post-footer {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-actions {
    display: flex;
    align-items: center;
}

.like-btn {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 16px;
    transition: color 0.3s;
}

.like-btn:hover,
.like-btn.liked {
    color: #ff4757;
}

.like-btn i {
    margin-right: 5px;
}

.like-count-only {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 16px;
}

.like-count-only i {
    margin-right: 5px;
    color: #ff4757;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.page-link {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: #f8f9fa;
}

.page-link.active {
    background-color: #ff4757;
    color: #fff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 0;
}

.empty-state p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 20px;
}

/* 认证页面样式 */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-box {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    width: 100%;
    max-width: 95%;
}

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

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

/* 个人主页样式 */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.profile-avatar {
    margin-right: 30px;
}

.profile-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-info h2 {
    font-size: 28px;
    margin-bottom: 10px;
}

.profile-info p {
    color: #6c757d;
}

.profile-tabs {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tabs {
    display: flex;
    list-style: none;
    border-bottom: 1px solid #eee;
}

.tabs li {
    flex: 1;
}

.tabs a {
    display: block;
    padding: 15px;
    text-align: center;
    color: #333;
    font-weight: 500;
    transition: all 0.3s;
}

.tabs li.active a {
    color: #ff4757;
    border-bottom: 2px solid #ff4757;
}

.tab-content {
    padding: 30px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    margin-bottom: 20px;
    color: #333;
}

.profile-form {
    max-width: 600px;
}

.avatar-preview {
    margin-bottom: 15px;
}

.avatar-preview img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 发布表白页面样式 */
.post-container {
    max-width: 95%;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

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

.image-preview-container {
    margin-bottom: 15px;
}

.image-preview {
    width: 100%;
    height: 200px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6c757d;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.image-preview.has-image {
    border: none;
}

/* 图片模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
}

/* 在文件末尾添加以下样式 */

/* 退出确认样式 */
.logout-confirm {
    text-align: center;
}

.logout-message {
    font-size: 18px;
    margin-bottom: 30px;
}

.logout-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* 多图片上传样式 */
.image-upload-container {
    margin-bottom: 15px;
}

.image-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    border: 2px dashed #ddd;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.image-preview-item:hover {
    border-color: #ff4757;
}

.image-preview-item.filled {
    border-style: solid;
    border-color: #ff4757;
}

.image-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #aaa;
    font-size: 24px;
}

.preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: none;
}

.image-preview-item.filled .preview-placeholder {
    display: none;
}

.image-preview-item.filled .preview-image {
    display: block;
}

.remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: none;
    z-index: 3;
}

.image-preview-item.filled .remove-image {
    display: block;
}

/* 多图片显示样式 */
.post-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.post-images.multiple-images .post-image-item:first-child:nth-last-child(1) {
    grid-column: span 3;
}

.post-images.multiple-images .post-image-item:first-child:nth-last-child(2),
.post-images.multiple-images .post-image-item:first-child:nth-last-child(2) ~ .post-image-item {
    grid-column: span 3 / 2;
}

.post-image-item {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    padding-bottom: 100%;
}

.post-image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-image-item:hover img {
    transform: scale(1.05);
}

/* 美化按钮 */
.btn {
    border-radius: 50px;
    padding: 12px 25px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #868e96);
}

/* 美化表白卡片 */
.post-card {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

/* 增强表白文字显眼度 */
.post-content p {
    text-align: left;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    font-weight: 500;
    letter-spacing: 0.3px;
}


.post-image-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    padding-bottom: 75%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.post-image-item img {
    opacity: 0.92;
    transition: opacity 0.3s, transform 0.3s;
}

.post-image-item:hover img {
    opacity: 1;
    transform: scale(1.03);
}

/* 美化头像 */
.avatar {
    border: 3px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 美化表单 */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea {
    border-radius: 8px;
    padding: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2);
}