/* 照片墙自定义样式 */

/* 全局样式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --dark-color: #212529;
    --light-color: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 导航栏 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand i {
    margin-right: 8px;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* 照片网格/瀑布流 */
.photo-grid {
    margin: 0 auto;
}

.photo-item {
    margin-bottom: 20px;
    break-inside: avoid;
}

.photo-item img {
    width: 100%;
    height: auto;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.photo-item img:hover {
    opacity: 0.9;
}

.photo-info {
    padding: 15px;
    background: white;
    border-radius: 0 0 8px 8px;
}

.photo-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.photo-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.photo-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #999;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.photo-stats {
    display: flex;
    gap: 15px;
}

.photo-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.photo-user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.photo-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    padding: 8px 20px;
    transition: all 0.3s ease;
}

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

.btn-like:hover {
    background: #f8f9fa;
    border-color: #dc3545;
    color: #dc3545;
}

.btn-like.liked {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* 上传区域 */
.upload-area {
    display: block;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: var(--success-color);
    background: #f0fff4;
}

.upload-area i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

.upload-area:hover i {
    color: var(--primary-color);
}

.upload-area .upload-trigger {
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.upload-area .upload-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.2);
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.preview-item {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    padding: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
}

.preview-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.preview-meta {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.8rem;
    color: #666;
}

.preview-item .remove-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(220, 53, 69, 0.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.preview-item .remove-preview:hover {
    background: rgba(220, 53, 69, 1);
}

/* 图片预览 */
.image-preview {
    max-width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-container {
    position: relative;
    display: inline-block;
}

.remove-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-preview:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* 登录/注册表单 */
.auth-container {
    max-width: 450px;
    margin: 50px auto;
}

.auth-card {
    border-radius: 12px;
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color), #0d47a1);
    color: white;
    padding: 30px;
    text-align: center;
}

.auth-header i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.auth-body {
    padding: 30px;
}

/* 用户资料 */
.profile-header {
    background: linear-gradient(135deg, var(--primary-color), #0d47a1);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.profile-info {
    text-align: center;
}

.profile-username {
    font-size: 2rem;
    font-weight: bold;
    margin: 15px 0 5px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.profile-stat {
    text-align: center;
}

.profile-stat-number {
    font-size: 1.5rem;
    font-weight: bold;
}

.profile-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 搜索框 */
.search-box {
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-box .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.search-box input {
    border: none;
    padding: 12px 20px;
}

.search-box button {
    border: none;
}

/* 图片灯箱 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

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

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: transform 0.3s ease;
}

.lightbox-close:hover {
    transform: scale(1.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(0,0,0,0.8);
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .photo-grid {
        column-count: 1;
    }
    
    .profile-header {
        padding: 30px 0;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
    }
    
    .profile-username {
        font-size: 1.5rem;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}

@media (min-width: 576px) {
    .photo-grid {
        column-count: 2;
        column-gap: 20px;
    }
}

@media (min-width: 992px) {
    .photo-grid {
        column-count: 3;
        column-gap: 20px;
    }
}

@media (min-width: 1200px) {
    .photo-grid {
        column-count: 4;
        column-gap: 20px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* 工具提示 */
.tooltip-inner {
    background-color: #333;
    border-radius: 4px;
}

/* 进度条 */
.upload-progress {
    margin-top: 20px;
}

.progress {
    height: 25px;
    border-radius: 8px;
}

.progress-bar {
    font-size: 0.9rem;
    line-height: 25px;
}
