/* Combined optimization styles: content-optimization.css + image-optimization.css */

/* 分享按钮样式 */
.share-buttons { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }
.share-btn { padding: 8px 15px; border: none; border-radius: 4px; background: #f5f5f5; color: #333; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background-color 0.3s ease; }
.share-btn:hover { background: #e0e0e0; }
.share-btn i { font-size: 16px; }

/* 二维码容器样式 */
.qr-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.qr-content { background: #fff; padding: 20px; border-radius: 8px; text-align: center; position: relative; }
.qr-content p { margin-top: 10px; color: #666; }
.close-qr { position: absolute; top: 5px; right: 5px; background: none; border: none; font-size: 20px; cursor: pointer; color: #666; }

/* 图片查看器样式 */
.image-viewer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.viewer-content { position: relative; max-width: 90%; max-height: 90%; }
.viewer-content img { max-width: 100%; max-height: 90vh; object-fit: contain; }
.close-viewer { position: absolute; top: -40px; right: -40px; background: none; border: none; color: #fff; font-size: 30px; cursor: pointer; }

/* 图片加载动画/优化 */
img[data-src] { opacity: 0; transition: opacity 0.3s ease-in-out; }
img.loaded { opacity: 1; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.loaded { opacity: 1; transition: opacity 0.3s ease-in; }

/* 轮播图加载指示器 */
.slider-loading { position: absolute; bottom: 0; left: 0; height: 2px; background: linear-gradient(to right, #4CAF50, #8BC34A); width: 0; transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out; z-index: 1000; }

/* 图片占位/错误/加载中 */
.image-placeholder { background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%); background-size: 200% 100%; animation: 1.5s shine linear infinite; min-height: 200px; }
@keyframes shine { to { background-position-x: -200%; } }
.image-error { position: relative; display: flex; align-items: center; justify-content: center; background: #f8f8f8; color: #666; font-size: 14px; padding: 20px; text-align: center; border: 1px solid #ddd; }
.image-error::before { content: '!'; display: block; width: 24px; height: 24px; line-height: 24px; text-align: center; background: #ff5722; color: #fff; border-radius: 50%; margin-right: 8px; }
.image-loading { position: relative; }
.image-loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 2px solid #f3f3f3; border-top: 2px solid #3498db; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 响应式图片容器与比例 */
.responsive-image-container { position: relative; width: 100%; height: 0; padding-bottom: 56.25%; overflow: hidden; }
.aspect-ratio-16-9 { padding-bottom: 56.25%; }
.aspect-ratio-4-3 { padding-bottom: 75%; }
.aspect-ratio-1-1 { padding-bottom: 100%; }
.responsive-image-container img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* WebP 回退样式（如需） */
.no-webp .webp-image { display: none; }
.webp .fallback-image { display: none; }

/* 响应式：按钮排列 */
@media (max-width: 768px) {
  .share-buttons { flex-direction: column; align-items: center; }
  .share-btn { width: 100%; justify-content: center; }
  .responsive-image-container { padding-bottom: 75%; }
}

