/* Profile页面专用样式 */

/* 登录提示卡片 */
.login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    max-width: 320px;
    width: 100%;
}

.login-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.login-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 30px;
}

.login-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-btn, .register-btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.register-btn {
    background: transparent;
    color: #4facfe;
    border: 2px solid #4facfe;
}

.register-btn:hover {
    background: #4facfe;
    color: white;
}

/* 用户信息卡片 */
.user-info-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    margin: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.user-id {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.user-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #4facfe;
}

.edit-profile-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #4facfe;
    font-size: 14px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s;
}

.edit-profile-btn:hover {
    background: rgba(79, 172, 254, 0.1);
}

/* 我的帖子区域 */
.my-posts-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    margin-top: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.post-count {
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 12px;
}

/* 帖子列表 */
.posts-list {
    padding: 0;
}

.post-item {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.3s;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background: #f8f9fa;
}

.post-image {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    margin-right: 16px;
    flex-shrink: 0;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.star-icon {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
}

.super-star {
    width: 24px;
    height: 24px;
}

/* 发布中标识 */
.publishing-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* 帖子坐标信息 */
.post-coordinate {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.post-info {
    flex: 1;
}

/* 第一行：鱼名字、星/蓝图标、重量 */
.post-fish-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.post-fish-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.post-star-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.post-star-icon.super-star {
    width: 18px;
    height: 18px;
}

.post-fish-weight {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    flex-shrink: 0;
}

/* 第二行：地图名称 */
.post-location {
    font-size: 14px;
    color: #4facfe;
    margin-bottom: 4px;
}

/* 第三行：时间和坐标 */
.post-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.post-weight {
    font-weight: 500;
}

.post-arrow {
    color: #ccc;
    font-size: 18px;
    margin-left: 12px;
}

/* 空状态 */
.empty-posts {
    text-align: center;
    padding: 40px 24px;
}

.empty-posts .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-posts .empty-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.create-post-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.create-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

/* 浮动发帖按钮 */
.floating-post-btn {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s ease;
    border: 2px solid #fff;
}

.floating-post-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 107, 107, 0.6);
}

.floating-post-btn:active {
    transform: scale(0.95);
}

.post-icon {
    font-size: 24px;
    color: white;
    font-weight: bold;
    line-height: 1;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .login-card {
        margin: 16px;
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 20px;
    }
    
    .user-info-card {
        margin: 12px;
        padding: 20px;
        flex-direction: column;
        text-align: left;
    }
    
    .user-avatar {
        width: 70px;
        height: 70px;
    }
    
    .user-stats {
        justify-content: flex-start;
        gap: 30px;
    }
    
    .edit-profile-btn {
        position: static;
        margin-top: 12px;
        align-self: center;
    }
    
    .my-posts-section {
        margin-bottom: 20px;
    }
    
    .section-header {
        padding: 16px 20px 12px;
    }
    
    .post-item {
        padding: 12px 20px;
    }
    
    .post-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .post-fish-name {
        font-size: 15px;
    }
    
    .post-star-icon {
        width: 14px;
        height: 14px;
    }
    
    .post-star-icon.super-star {
        width: 16px;
        height: 16px;
    }
    
    .post-fish-weight {
        font-size: 13px;
    }
    
    .post-location {
        font-size: 13px;
    }
    
    .post-meta {
        font-size: 11px;
        gap: 8px;
    }
    
    .floating-post-btn {
        width: 48px;
        height: 48px;
        bottom: 90px;
        right: 16px;
    }
    
    .post-icon {
        font-size: 20px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .post-item:hover {
        background: transparent;
    }
    
    .post-item:active {
        background: #f8f9fa;
    }
    
    .floating-post-btn:hover {
        transform: none;
    }
    
    .floating-post-btn:active {
        transform: scale(0.95);
    }
}

/* 头像编辑相关样式 */
.user-avatar {
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.avatar-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.user-avatar:hover .avatar-edit-overlay {
    opacity: 1;
}

.edit-icon {
    color: white;
    font-size: 20px;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
}

.modal-body {
    padding: 24px;
}

/* 头像上传区域 */
.avatar-upload-area {
    text-align: center;
}

.upload-placeholder {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.upload-placeholder:hover {
    border-color: #4facfe;
    background: #f8fcff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.upload-placeholder p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 头像裁剪区域 */
.avatar-crop-area {
    text-align: center;
}

#avatarCanvas {
    border: 2px solid #f0f0f0;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #fafafa;
}

.crop-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9e9e9;
}

/* 用户信息编辑表单样式 */
.profile-edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    min-width: 80px;
}

/* 用户名行样式 */
.user-name-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 登出链接样式 */
.logout-link {
    color: #6c9bd1;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logout-link:hover {
    color: #4a7ba7;
    text-decoration: underline;
}
