/**
 * 一人一册（一人一册）照片相关样式
 * @author  云蓝图科技
 * @date    2024年12月25日
 * @version 1.0.0
 */

/* ================================
   照片网格展示
================================ */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
}

.photo-grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.photo-grid-4 {
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:active img {
    transform: scale(1.05);
}

/* 照片选中状态 */
.photo-item.selected::after {
    content: '\f00c';
    font-family: FontAwesome;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    background: var(--wrce-primary, #6366f1);
    color: #fff;
    font-size: 12px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    border: 2px solid #fff;
}

.photo-item.selected::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.2);
    z-index: 1;
}

/* ================================
   照片详情页
================================ */
.photo-viewer {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.photo-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.photo-viewer-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.photo-viewer-title {
    font-size: 16px;
    font-weight: 500;
}

.photo-viewer-actions {
    display: flex;
    gap: 8px;
}

.photo-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.photo-viewer-footer {
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

.photo-viewer-info {
    font-size: 14px;
    line-height: 1.6;
}

/* ================================
   照片上传
================================ */
.photo-upload {
    padding: 16px;
}

.photo-upload-area {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s;
}

.photo-upload-area.dragover {
    border-color: var(--wrce-primary, #6366f1);
    background: rgba(99, 102, 241, 0.05);
}

.photo-upload-icon {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 16px;
}

.photo-upload-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.photo-upload-hint {
    font-size: 12px;
    color: #999;
}

.photo-upload-input {
    display: none;
}

/* 上传预览 */
.photo-upload-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
}

.photo-preview-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
}

.photo-preview-progress-bar {
    height: 100%;
    background: var(--wrce-primary, #6366f1);
    transition: width 0.3s;
}

/* 添加按钮 */
.photo-upload-add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
}

.photo-upload-add i {
    font-size: 24px;
    color: #999;
    margin-bottom: 4px;
}

.photo-upload-add span {
    font-size: 12px;
    color: #999;
}

/* ================================
   照片瀑布流
================================ */
.photo-waterfall {
    column-count: 2;
    column-gap: 8px;
    padding: 8px;
}

.photo-waterfall-item {
    break-inside: avoid;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.photo-waterfall-item img {
    width: 100%;
    height: auto;
    display: block;
}

.photo-waterfall-info {
    padding: 8px 12px;
}

.photo-waterfall-title {
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-waterfall-meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* ================================
   照片时间线
================================ */
.photo-timeline {
    padding: 16px;
}

.photo-timeline-section {
    margin-bottom: 24px;
}

.photo-timeline-date {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 3px solid var(--wrce-primary, #6366f1);
}

.photo-timeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

/* ================================
   照片EXIF信息
================================ */
.photo-exif {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    margin: 16px;
}

.photo-exif-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.photo-exif-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.photo-exif-item {
    display: flex;
    flex-direction: column;
}

.photo-exif-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 2px;
}

.photo-exif-value {
    font-size: 14px;
    color: #333;
}

/* ================================
   照片人物标签
================================ */
.photo-people {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
}

.photo-people-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

.photo-people-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 4px;
}

.photo-people-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-people-name {
    font-size: 12px;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* ================================
   照片标签云
================================ */
.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
}

.photo-tag {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    border-radius: 14px;
    transition: all 0.2s;
}

.photo-tag:active {
    background: var(--wrce-primary, #6366f1);
    color: #fff;
}

.photo-tag-count {
    margin-left: 4px;
    font-size: 11px;
    color: #999;
}

/* ================================
   照片地点
================================ */
.photo-location {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    margin: 16px;
}

.photo-location-icon {
    width: 40px;
    height: 40px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--wrce-primary, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
}

.photo-location-info {
    flex: 1;
}

.photo-location-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.photo-location-address {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* ================================
   空状态
================================ */
.photo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.photo-empty-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 16px;
}

.photo-empty-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.photo-empty-desc {
    font-size: 14px;
    color: #999;
    margin-bottom: 24px;
}

.photo-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 24px;
    background: var(--wrce-primary, #6366f1);
    color: #fff;
    font-size: 14px;
    border-radius: 20px;
    text-decoration: none;
}

/* ================================
   加载更多
================================ */
.photo-loadmore {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.photo-loadmore-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #eee;
    border-top-color: var(--wrce-primary, #6366f1);
    border-radius: 50%;
    margin-right: 8px;
    animation: photo-spin 0.8s linear infinite;
}

@keyframes photo-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   手势操作提示
================================ */
.photo-gesture-tip {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 13px;
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-gesture-tip.show {
    opacity: 1;
}

