﻿/* 照片管理样式 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.photo-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.photo-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #f3f4f6;
}

.photo-info {
    padding: 12px;
}

.photo-type {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.photo-time {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.photo-size {
    font-size: 11px;
    color: #9ca3af;
}

/* 照片上传表单 */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.photo-preview {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.photo-preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-photo:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.file-name {
    padding: 4px 8px;
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f9fafb;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

input[type="file"]:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

/* 照片查看器 */
.photo-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.photo-viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.photo-viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-viewer-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.photo-viewer-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* 上传按钮 */
.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-upload:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

/* 响应式 */
@media (max-width: 768px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .photo-image {
        height: 150px;
    }
    
    .preview-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .photo-preview img {
        height: 100px;
    }
}
