/* ===== 照片应用 — Apple 相册风格 ===== */

#scene-photos {
    background: #000;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* ── 导航栏 ── */
.photos-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(14px + var(--safe-top)) 16px 6px;
    background: #000;
    flex-shrink: 0;
    position: relative;
}

.photos-nav-back {
    width: 40px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: absolute;
    left: 2px;
    top: calc(14px + var(--safe-top));
}

.photos-nav-back:active { opacity: 0.5; }

.photos-nav-back svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 2.5;
}

.photos-nav-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin-left: 4px;
}

.photos-nav-actions {
    display: flex;
    gap: 4px;
}

.photos-nav-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.photos-nav-btn:active { background: rgba(255,255,255,0.1); }

.photos-nav-btn svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 1.8;
    fill: none;
}

/* ── 标签栏 ── */
.photos-tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 4px 0 calc(4px + var(--safe-bottom));
    background: rgba(0, 0, 0, 0.95);
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.photos-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.photos-tab.active {
    opacity: 1;
}

.photos-tab:active { opacity: 0.6; }

.photos-tab svg {
    width: 24px;
    height: 24px;
    stroke: rgba(255, 255, 255, 0.85);
    stroke-width: 1.5;
    fill: none;
}

.photos-tab.active svg {
    stroke-width: 2.2;
}

.photos-tab-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

/* ── 照片网格内容区 ── */
.photos-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #000;
}

.photos-content::-webkit-scrollbar {
    display: none;
}

/* ── 年份/月份标题 ── */
.photos-section-header {
    padding: 20px 16px 6px;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.photos-section-header-sub {
    padding: 4px 16px 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* ── 照片网格 ── */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    padding: 0;
}

.photos-grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
}

.photos-grid-item:active {
    opacity: 0.7;
}

.photos-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.photos-grid-item:active img {
    transform: scale(1.05);
}

/* ── 相簿模式（列表） ── */
.photos-albums {
    padding: 8px 16px;
}

.photos-album-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.photos-album-row:active { opacity: 0.6; }

.photos-album-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #1a1a1a;
}

.photos-album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photos-album-info {
    flex: 1;
}

.photos-album-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.photos-album-count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1px;
}

.photos-album-chevron {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 2;
    fill: none;
}

/* ── 照片详情（全屏） ── */
.photos-detail {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 10;
    display: none;
    flex-direction: column;
}

.photos-detail.show {
    display: flex;
    animation: photoDetailIn 0.25s ease;
}

@keyframes photoDetailIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.photos-detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(14px + var(--safe-top)) 8px 6px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

.photos-detail-back {
    width: 40px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photos-detail-back:active { opacity: 0.5; }

.photos-detail-back svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 2.5;
}

.photos-detail-actions {
    display: flex;
    gap: 2px;
}

.photos-detail-action {
    width: 40px;
    height: 36px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photos-detail-action:active { opacity: 0.5; }

.photos-detail-action svg {
    width: 22px;
    height: 22px;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 1.8;
    fill: none;
}

.photos-detail-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photos-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.photos-detail-bottom {
    padding: 12px 16px calc(8px + var(--safe-bottom));
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 5;
}

.photos-detail-date {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

/* ── 空状态 ── */
.photos-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: rgba(255, 255, 255, 0.3);
    gap: 12px;
    padding: 60px 20px;
}

.photos-empty svg {
    width: 48px;
    height: 48px;
    stroke: rgba(255, 255, 255, 0.2);
    fill: none;
    stroke-width: 1.5;
}

.photos-empty-text {
    font-size: 16px;
    font-weight: 500;
}

.photos-empty-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.2);
}
