/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

html, body {
    height: 100%;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    position: relative;
}

.main {
    flex: 1;
}

/* 柔和海浪背景（低饱和度，缓慢流动） */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(1200px 600px at -10% 20%, rgba(102,126,234,0.06), transparent 60%),
      radial-gradient(1000px 500px at 110% 80%, rgba(118,75,162,0.06), transparent 60%),
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="120" viewBox="0 0 400 120"><path d="M0 60 Q 50 30 100 60 T 200 60 T 300 60 T 400 60" fill="none" stroke="%2399a2ff" stroke-opacity="0.18" stroke-width="2"/></svg>'),
      url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="120" viewBox="0 0 400 120"><path d="M0 70 Q 50 40 100 70 T 200 70 T 300 70 T 400 70" fill="none" stroke="%2387a8ff" stroke-opacity="0.12" stroke-width="2"/></svg>');
    background-repeat: no-repeat, no-repeat, repeat, repeat;
    background-size: 120% 120%, 120% 120%, 400px 120px, 400px 120px;
    background-position: 0% 0%, 100% 100%, 0 0, 200px 60px;
    animation: waveScroll 40s linear infinite;
}

@keyframes waveScroll {
    0% { background-position: 0% 0%, 100% 100%, 0 0, 200px 60px; }
    100% { background-position: 0% 0%, 100% 100%, -400px 0, -200px 60px; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 60px 0;
    margin-bottom: 40px;
}

.title {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 300;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Header浏览模式选择器样式 */
.header-subtitle-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    position: relative;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
    text-align: center;
}

.view-mode-selector {
    position: absolute;
    right: 0;
}

.view-mode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 120px;
    justify-content: center;
}

.view-mode-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-text {
    white-space: nowrap;
}

.btn-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.view-mode-btn.active .btn-arrow {
    transform: rotate(180deg);
}

.view-mode-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
    min-width: 140px;
}

.view-mode-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #333;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.dropdown-item.active {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    font-weight: 600;
}

/* 筛选按钮 */
.gallery-controls {
    text-align: center;
    margin-bottom: 40px;
}

/* 标签控件：分隔样式 [ A | B | C ] */
#tagControls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: center;
    line-height: 1.8;
}
#tagControls .filter-btn {
    border: none;
    background: transparent;
    color: #495057;
    padding: 6px 10px;
    margin: 0;
    border-radius: 6px;
}
#tagControls .filter-btn:not(.active):hover { color: #111; background: rgba(0,0,0,0.04); }
#tagControls .filter-btn.active { color: #111; text-decoration: underline; text-underline-offset: 4px; background: rgba(0,0,0,0.04); }
.tag-bracket, .tag-sep { color: #c0c4cc; pointer-events: none; user-select: none; }

/* 照片异步加载样式（占位） */
.photo-item img[loading="lazy"] { filter: blur(0); }
.img-skeleton { background: #e9ecef; width: 100%; height: 250px; }

/* 分页 */
.pagination { display:flex; justify-content:center; gap:8px; margin-top: 10px; }
.pagination button { padding:8px 12px; border:1px solid #dee2e6; background:white; border-radius:8px; cursor:pointer; }
.pagination button.active { background:#667eea; color:#fff; border-color:#667eea; }
.pagination button:disabled { opacity: .5; cursor:not-allowed; }

.add-photo {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: #2c3e50;
}

#addPhotoForm .form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

#addPhotoForm label {
    font-size: 0.95rem;
    color: #495057;
}

#addPhotoForm input[type="text"],
#addPhotoForm input[type="url"],
#addPhotoForm select,
#addPhotoForm textarea {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    background: #fff;
    font-size: 0.95rem;
}

.form-actions {
    margin-top: 8px;
}

.primary-btn {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    background: #556cd6;
}

.form-tip {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 8px;
}

.filter-btn {
    background: white;
    border: 2px solid #e9ecef;
    color: #6c757d;
    padding: 12px 24px;
    margin: 0 8px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 标签显示 */
.photo-tags {
    display: flex;
    flex-wrap: wrap;
}
.tag {
    color: #007bff;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tag:hover {
    color: #0056b3;
}

.tag:not(:last-child)::after {
    content: "\00a0|\00a0";
    color: #6c757d;
    margin-left: 2px;
    margin-right: 2px;
}

/* 照片网格 */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.photo-item {
    background: #fafbfc;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f2f5;
    transition: all 0.3s ease;
    cursor: pointer;
}

.photo-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    border-color: #e1e5e9;
}

/* 浏览模式样式控制 - 简化版本 */
.photo-item.image-only {
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
}

.photo-item.image-only:hover {
    transform: none;
    box-shadow: none;
}

/* 纯图片模式完全隐藏信息区域 */
.photo-item.image-only .photo-info {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
}

/* 纯图片模式消除所有余白 */
.photo-item.image-only {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 12px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.photo-item.image-only img {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    aspect-ratio: auto !important;
    height: auto !important;
    width: 100% !important;
    object-fit: cover !important;
}

.photo-item.image-only:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* 纯图片模式样式 */
.photo-item.image-only {
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
}

.photo-item.image-only:hover {
    transform: none;
    box-shadow: none;
}

.photo-item img {
    width: 100%;
    aspect-ratio: 4 / 3; /* 更稳的缩略图比例，替代固定高度 */
    height: auto;
    object-fit: cover;
    transition: transform 0.3s ease;
    
    /* 改善图片质量 */
    image-rendering: -webkit-optimize-contrast; /* Safari/Chrome */
    image-rendering: -moz-crisp-edges; /* Firefox */
    image-rendering: crisp-edges; /* 标准 */
    image-rendering: -o-crisp-edges; /* Opera */
    
    /* 现代浏览器的图片渲染优化 */
    image-rendering: pixelated; /* 保持像素清晰 */
    
    /* 添加微妙的阴影来掩盖锯齿 */
    filter: contrast(1.02) brightness(1.01);
    
    /* 确保图片不会因为缩放而模糊 */
    backface-visibility: hidden;
    transform: translateZ(0);
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.photo-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.3;
    min-height: 1.3em;
}

.photo-title:empty::before {
    content: "无标题";
    color: #adb5bd;
    font-style: normal;
}

.photo-description {
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.3em;
}

.photo-description:empty::before {
    content: "无详情";
    color: #adb5bd;
    font-style: normal;
}

.photo-category {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-top: 10px;
}

/* 灯箱样式 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox-content { 
    position: relative; 
    max-width: 95%; 
    max-height: 90%; 
    margin: auto; 
    padding: 0 32px; 
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box; /* 确保padding不会影响总尺寸 */
}

.lightbox-body { 
    display: flex; 
    gap: clamp(16px, 2vw, 32px); /* 响应式间距 */
    align-items: center; /* 改为居中对齐，让所有元素垂直居中 */
    min-height: 400px; /* 确保最小高度，避免UI挤在一起 */
    height: clamp(60vh, 85vh, 90vh); /* 响应式高度 */
}

.lightbox-image-container {
    position: relative;
    flex: 3; /* 调整图片区域比例，为箭头留出空间 */
    height: clamp(60vh, 85vh, 90vh); /* 响应式高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px; /* 保持最小高度作为底线 */
}

.lightbox-image { 
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 居中定位 */
    max-width: 100%; 
    max-height: 100%; 
    width: auto; /* 让图片保持原始宽高比 */
    height: auto; /* 让图片保持原始宽高比 */
    object-fit: contain; 
    border-radius: 8px;
    background: #1a1a1a; /* 图片加载时的背景色 */
    
    /* 改善大图质量 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: -o-crisp-edges;
    
    /* 大图使用高质量渲染 */
    image-rendering: auto;
    
    /* 确保图片清晰度 */
    backface-visibility: hidden;
    transform: translate(-50%, -50%) translateZ(0); /* 保持居中并添加硬件加速 */
    
    /* 添加微妙的锐化效果 */
    filter: contrast(1.01);
    
    /* 图片加载状态 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image.loaded {
    opacity: 1;
}

/* 图片加载特效 */
.lightbox-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #ffffff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.lightbox-image.loaded::before {
    opacity: 0;
}

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

/* 图片加载占位符 */
.lightbox-image-placeholder {
    width: 80%; /* 调整宽度，与新的flex比例保持一致 */
    height: clamp(60vh, 85vh, 90vh); /* 响应式高度，与容器保持一致 */
    min-height: 400px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.lightbox-image-placeholder::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #ffffff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.lightbox-image-placeholder::after {
    content: 'Loading...';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #6c757d;
    font-size: 14px;
    opacity: 0.8;
}
.lightbox-info { 
    flex: 0.8; /* 减少20%左右，让信息框更窄 */
    color: #f8f9fa; 
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-left: 1px solid #334155; 
    padding: clamp(16px, 2vw, 24px); /* 响应式内边距 */
    border-radius: 12px; 
    overflow: auto; 
    height: clamp(60vh, 85vh, 90vh); /* 响应式高度，与容器保持一致 */
    box-sizing: border-box; /* 确保padding不会影响总宽度 */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.info-title { 
    font-size: clamp(1.1rem, 2.5vw, 1.4rem); /* 响应式字体大小 */
    margin-bottom: clamp(12px, 1.5vw, 16px); /* 响应式边距 */
    color: #f1f5f9;
    font-weight: 600;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: clamp(6px, 1vw, 8px); /* 响应式内边距 */
}

.info-desc { 
    color: #cbd5e1; 
    line-height: 1.6; 
    margin-bottom: clamp(16px, 2vw, 20px); /* 响应式边距 */
    font-size: clamp(0.85rem, 2vw, 0.95rem); /* 响应式字体大小 */
}

.info-tags { 
    display: flex; 
    flex-wrap: wrap; 
    gap: clamp(6px, 1vw, 8px); /* 响应式间距 */
    margin-bottom: clamp(16px, 2vw, 20px); /* 响应式边距 */
}

.info-tags .tag { 
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); 
    color: #fff; 
    padding: clamp(5px, 1vw, 6px) clamp(10px, 1.5vw, 12px); /* 响应式内边距 */
    border-radius: 20px;
    font-size: clamp(0.75rem, 1.8vw, 0.85rem); /* 响应式字体大小 */
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* EXIF元数据样式 */
.exif-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #334155;
}

.exif-title {
    font-size: 0.88rem; /* 减少20%左右，从1.1rem变为0.88rem */
    color: #f1f5f9;
    margin-bottom: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.exif-title::before {
    content: "📷";
    font-size: 1.2rem;
}

.exif-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.exif-item {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.exif-item:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.exif-label {
    font-size: 0.8rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

.exif-value {
    font-size: 0.95rem;
    color: #e2e8f0;
    font-weight: 500;
}

/* 重要参数高亮 */
.exif-item.important {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.exif-item.important .exif-label {
    color: #86efac;
}

.exif-item.important .exif-value {
    color: #bbf7d0;
}

/* 相机参数样式 - 使用暗色避免喧宾夺主 */
.exif-item.camera-param {
    background: rgba(75, 85, 99, 0.1);
    border-color: rgba(75, 85, 99, 0.3);
}

.exif-item.camera-param .exif-label {
    color: #9ca3af;
}

.exif-item.camera-param .exif-value {
    color: #d1d5db;
}

/* 滚动条样式 */
.lightbox-info::-webkit-scrollbar {
    width: 6px;
}

.lightbox-info::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.lightbox-info::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.5);
    border-radius: 3px;
}

.lightbox-info::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.7);
}

/* 移除重复的 .lightbox-image 通用规则以避免覆盖上面的尺寸设置 */

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

.close-btn:hover {
    background: rgba(0,0,0,0.8);
}

/* 重新设计为水平排列布局 */
.lightbox-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* 防止箭头被压缩 */
    pointer-events: auto;
    z-index: 1;
}

/* 左右箭头样式 */
.lightbox-nav .prev-btn,
.lightbox-nav .next-btn {
    position: relative;
}



/* 调整箭头按钮样式，适合左下角布局 */
.nav-btn {
    background: rgba(17, 24, 39, 0.9); 
    color: #ffffff; 
    border: 1px solid rgba(255, 255, 255, 0.4); 
    font-size: 1rem; 
    padding: 8px 12px; 
    cursor: pointer; 
    border-radius: 8px; 
    transition: all 0.2s ease; 
    pointer-events: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.nav-btn:hover { 
    background: rgba(31, 41, 55, 1); 
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}



.nav-btn { background: #111827; color: #ffffff; border: 1px solid #ffffff; font-size: 1.1rem; padding: 10px 14px; cursor: pointer; border-radius: 10px; transition: background 0.2s ease, border-color 0.2s ease; pointer-events: auto; }
.nav-btn:hover { background: #1f2937; border-color: #ffffff; }

/* 页脚 */
.footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    /* 移动端Header浏览模式选择器样式 */
    .header-subtitle-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .view-mode-selector {
        position: static;
        margin-top: 10px;
    }
    
    .view-mode-btn {
        min-width: 100px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .view-mode-dropdown {
        min-width: 120px;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        margin: 5px;
        font-size: 0.9rem;
    }
    
    .lightbox-content { 
        max-width: 100%; 
        max-height: 100%; 
        padding: 56px 16px 0; 
    }
    .lightbox-body { 
        flex-direction: column; 
        gap: 16px; 
        height: auto; /* 移动端使用自适应高度 */
    }
    .lightbox-image-container { 
        width: 100%; 
        height: 60vh; /* 移动端调整高度 */
        min-height: 300px;
    }
    .lightbox-image { 
        max-width: 100%; 
        max-height: 100%; 
    }
    .lightbox-image-placeholder { 
        width: 100%; 
        height: 60vh; /* 移动端调整高度 */
        min-height: 300px;
    }
    .lightbox-info { 
        width: 100%; 
        padding: 16px; 
        border-radius: 8px; 
        height: auto; /* 移动端使用自适应高度 */
    }
    
    /* 移动端信息栏文字优化 */
    .info-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
        padding-bottom: 6px;
    }
    
    .info-desc {
        font-size: 0.85rem;
        margin-bottom: 16px;
        line-height: 1.5;
    }
    
    .info-tags .tag {
        padding: 4px 10px;
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    /* 移动端EXIF信息优化 */
    .exif-section {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .exif-title {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .exif-grid {
        gap: 8px;
    }
    
    .exif-item {
        padding: 8px;
    }
    
    .exif-label {
        font-size: 0.7rem;
        margin-bottom: 3px;
    }
    
    .exif-value {
        font-size: 0.8rem;
    }
    
    .lightbox-nav { padding: 0 16px; }

    /* 移动端：将左右箭头移到图片左上角，样式匹配关闭按钮 */
    .lightbox-nav {
        position: absolute;
        top: 8px;
        left: 8px;
        right: auto;
        transform: none;
        justify-content: flex-start;
        gap: 16px;
        pointer-events: auto;
        z-index: 1001;
    }
    .nav-btn {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: none;
        background: rgba(0,0,0,0.5);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }
    .nav-btn:hover { background: rgba(0,0,0,0.8); }

    /* 移动端：关闭按钮与箭头平行放置在右上方 */
    .close-btn {
        top: 8px;
        right: 12px;
        background: rgba(0,0,0,0.5);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        z-index: 1001;
    }
    .close-btn:hover { background: rgba(0,0,0,0.8); }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        display: block;
        margin: 5px auto;
        width: 80%;
    }
    
    /* 超小屏幕灯箱优化 */
    .lightbox-info {
        padding: 12px;
    }
    
    .info-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .info-desc {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .exif-title {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .exif-item {
        padding: 6px;
    }
    
    .exif-label {
        font-size: 0.65rem;
    }
    
    .exif-value {
        font-size: 0.75rem;
    }
    /* 紧凑型标签条，单行横向滚动，减小间距与字号 */
    .gallery-controls { margin-bottom: 16px; }
    #tagControls {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        gap: 0;
        line-height: 1.4;
        padding: 2px 6px;
    }
    #tagControls .tag-bracket { display: none; }
    #tagControls .tag-sep { margin: 0 6px; color: #b0b4bb; }
    #tagControls .filter-btn {
        padding: 4px 8px;
        font-size: 0.85rem;
        background: transparent;
    }
    #tagControls .filter-btn.active {
        text-underline-offset: 3px;
        background: transparent;
    }
}
