* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #3498db;
    --secondary-color: #9b59b6;
    --accent-color: #e74c3c;
    --dark-bg: #2c3e50;
    --light-bg: #ecf0f1;
    --text-dark: #34495e;
    --text-light: #ecf0f1;
    --card-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark-bg), #1a2530);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.header {
    padding: 15px 20px;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 60px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 8px;
    color: var(--primary-color);
}

.search-container {
    display: flex;
    width: 100%;
    max-width: 280px;
    margin: 0 15px;
}

.search-input {
    flex: 1;
    padding: 8px 15px;
    border-radius: 25px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.menu-icon {
    font-size: 1.3rem;
    color: var(--text-light);
    cursor: pointer;
}

.container {
    max-width: 100%;
    margin: 70px 15px 80px;
}

.tabs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-right: 10px;
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab.active {
    background: var(--primary-color);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out;
    will-change: transform; /* 优化动画性能 */
}

.photo-item:nth-child(odd) {
    animation-delay: 0.1s;
}

.photo-item:nth-child(even) {
    animation-delay: 0.2s;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.photo-item.video::after {
    content: '\f04b';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    opacity: 0.8;
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    backface-visibility: hidden; /* 优化渲染性能 */
    transform: translateZ(0); /* 启用硬件加速 */
}

/* 图片占位符样式 */
.photo-item .thumbnail {
    transition: opacity 0.3s ease;
}

.photo-item .thumbnail[src*="data:image/svg+xml"] {
    opacity: 0.6;
}

/* 优化图片加载性能 */
.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out;
    will-change: transform; /* 优化动画性能 */
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    backface-visibility: hidden; /* 优化渲染性能 */
    transform: translateZ(0); /* 启用硬件加速 */
}

.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.viewer-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-container {
    max-width: 100%;
    max-height: 80%;
    position: relative;
    margin-top: 50px; /* 为顶部固定的photo-position留出空间 */
    margin-bottom: 80px; /* 为底部固定的photo-info留出空间 */
}

.fullscreen-img, .fullscreen-video {
    max-width: 100%;
    max-height: 75vh; /* 恢复更大的高度，因为文字现在固定在底部 */
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.1);
    object-fit: contain;
}

.fullscreen-video {
    width: 100%;
}

.close-viewer {
    position: absolute;
    top: 60px;
    right: 20px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex; /* 恢复显示按钮 */
    align-items: center;
    justify-content: center;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.rotate-btn {
    position: absolute;
    top: 60px;
    left: 20px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1010;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.rotate-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.rotate-btn.hidden {
    display: none;
}

.fullscreen-img.rotated {
    transition: transform 0.3s ease;
}

/* 触摸滑动相关样式 */
.fullscreen-viewer {
    touch-action: pan-y pinch-zoom;
}

.media-container {
    touch-action: none;
}

.photo-info {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 15px 20px;
    color: white;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1010;
}

.photo-title {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-date {
    font-size: 0.85rem;
    opacity: 0.8;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-position {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    font-size: 0.8rem;
    opacity: 0.9;
    display: block;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    z-index: 1010;
    backdrop-filter: blur(10px);
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 0.75rem;
    opacity: 0.7;
    transition: var(--transition);
    cursor: pointer;
    width: 20%;
}

.nav-item.active {
    color: var(--primary-color);
    opacity: 1;
}

.nav-item i {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.category-section {
    margin-bottom: 30px;
    animation: slideIn 0.5s ease-out;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.view-all {
    font-size: 0.85rem;
    color: var(--primary-color);
    opacity: 0.8;
}

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

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

/* 响应式设计 */
@media (min-width: 480px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

@media (min-width: 768px) {
    .container {
        margin: 70px 40px 80px;
    }
    
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .tab {
        padding: 10px 20px;
        font-size: 1rem;
    }
} 

/* 加载状态样式 */
.loading-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    z-index: 2;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

.loading-text {
    color: white;
    font-size: 0.75rem;
    opacity: 0.8;
}

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

/* 响应式图片优化 */
@media (max-width: 480px) {
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }
    
    .loading-spinner {
        width: 24px;
        height: 24px;
        border-width: 2px;
    }
    
    .loading-text {
        font-size: 0.7rem;
    }
    
    /* 移动端全屏查看器优化 */
    .media-container {
        margin-top: 40px;
        margin-bottom: 70px;
    }
    
    .fullscreen-img, .fullscreen-video {
        max-height: 70vh;
    }
    
    .photo-info {
        padding: 10px 15px;
    }
    
    .photo-position {
        padding: 8px 15px;
        font-size: 0.7rem;
    }
    
    .close-viewer {
        top: 50px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    .rotate-btn {
        top: 50px;
        left: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .thumbnail {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
} 

/* 全屏加载状态 */
.fullscreen-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    padding: 20px;
    z-index: 1020;
}

.fullscreen-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.fullscreen-loading .loading-text {
    color: white;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 图片加载优化 */
.fullscreen-img {
    transition: opacity 0.3s ease;
}

.fullscreen-img[src*="thumbnail"] {
    filter: blur(1px);
} 

/* 照片描述文字样式 */
.photo-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    padding: 20px 12px 12px;
    color: white;
    font-size: 0.8rem;
    line-height: 1.3;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.photo-item:hover .photo-description,
.photo-item:focus .photo-description {
    opacity: 1;
}

.photo-description .photo-title {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.photo-description .photo-date {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* 调整照片项的高度以适应描述文字 */
.photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1/1;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out;
    will-change: transform; /* 优化动画性能 */
}

/* 移动端优化 */
@media (max-width: 480px) {
    .photo-description {
        padding: 15px 10px 10px;
        font-size: 0.75rem;
    }
    
    .photo-description .photo-title {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }
    
    .photo-description .photo-date {
        font-size: 0.7rem;
    }
    
    .photo-position {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
} 

/* 平板端优化 */
@media (min-width: 768px) {
    .photo-description {
        padding: 25px 15px 15px;
        font-size: 0.85rem;
    }
    
    .photo-description .photo-title {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    
    .photo-description .photo-date {
        font-size: 0.8rem;
    }
    
    .photo-position {
        font-size: 0.85rem;
        padding: 12px 20px;
    }
} 

/* 触摸设备支持 - 在移动端默认显示描述文字 */
@media (hover: none) and (pointer: coarse) {
    .photo-description {
        opacity: 1;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    }
}

/* 桌面端保持hover效果 */
@media (hover: hover) {
    .photo-description {
        opacity: 0;
    }
    
    .photo-item:hover .photo-description,
    .photo-item:focus .photo-description {
        opacity: 1;
    }
}

/* 详情页面样式 */
.detail-container {
    display: none;
    margin-top: 20px;
    padding: 0 20px;
    animation: fadeIn 0.3s ease-in-out;
}

.detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    display: flex;
    align-items: center;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 20px;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(52, 152, 219, 0.1);
}

.back-btn:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateX(-2px);
}

.back-btn i {
    margin-right: 8px;
    font-size: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 10px;
}

/* 详情页面中的图片项目特殊样式 */
.detail-grid .photo-item {
    margin: 4px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (min-width: 480px) {
    .detail-container {
        padding: 0 30px;
    }
    
    .detail-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
        padding: 0 15px;
    }
    
    .detail-grid .photo-item {
        margin: 6px;
        border-radius: 12px;
    }
}

@media (min-width: 768px) {
    .detail-container {
        padding: 0 40px;
    }
    
    .detail-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px;
        padding: 0 20px;
    }
    
    .detail-grid .photo-item {
        margin: 8px;
        border-radius: 14px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 480px) {
    .detail-container {
        padding: 0 15px;
    }
    
    .detail-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
        padding: 0 5px;
    }
    
    .detail-grid .photo-item {
        margin: 3px;
        border-radius: 8px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }
    
    .detail-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .back-btn {
        font-size: 0.8rem;
        margin-right: 15px;
    }
    
    .back-btn i {
        font-size: 0.9rem;
    }
} 

/* 用户信息样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#welcome-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    transform: translateY(-1px);
}

/* 登录遮罩层样式 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-overlay.show {
    opacity: 1;
    visibility: visible;
}

.login-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.login-overlay.show .login-container {
    transform: translateY(0);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--text-primary);
    margin: 10px 0;
    font-size: 1.8rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group i {
    color: var(--text-secondary);
    margin-right: 12px;
    font-size: 1.1rem;
}

.input-group input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-secondary);
}

.login-btn {
    background: linear-gradient(135deg, var(--accent-color), #2980b9);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.cancel-btn {
    background: rgba(149, 165, 166, 0.1);
    border: 1px solid rgba(149, 165, 166, 0.3);
    color: #95a5a6;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cancel-btn:hover {
    background: rgba(149, 165, 166, 0.2);
    transform: translateY(-2px);
}

.cancel-btn:active {
    transform: translateY(0);
}

.login-error {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .login-header h2 {
        font-size: 1.5rem;
    }
    
    .user-info {
        gap: 10px;
    }
    
    #welcome-text {
        font-size: 0.8rem;
    }
    
    .logout-btn {
        padding: 6px 10px;
    }
    
    .cancel-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
} 

/* 详情页登录提示样式 */ 