/* 小蚂蚁回收产品图库 - 样式文件 */
:root { --wx-green: #07C160; --wx-green-light: #E8F8EE; --wx-green-dark: #06AD56; --danger: #FA5151; --text: #333; --text-light: #999; --bg: #F5F5F5; --white: #FFF; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background: var(--bg); color: var(--text); padding-top: 70px; }

/* 顶部导航 */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: 70px; background: var(--wx-green); color: white; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.navbar-content { max-width: 1400px; margin: 0 auto; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.navbar-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 600; }
.navbar-brand img { height: 40px; width: auto; }
.navbar-nav { display: flex; gap: 30px; }
.navbar-nav a { color: white; text-decoration: none; font-size: 15px; opacity: 0.9; transition: opacity 0.2s; }
.navbar-nav a:hover { opacity: 1; }
.navbar-actions { display: flex; gap: 10px; align-items: center; }
.btn-nav { background: rgba(255,255,255,0.2); color: white; border: none; padding: 8px 16px; border-radius: 20px; cursor: pointer; font-size: 14px; transition: background 0.2s; }
.btn-nav:hover { background: rgba(255,255,255,0.3); }
.user-info { font-size: 13px; opacity: 0.9; }

/* 主体 */
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* 搜索栏 */
.search-bar { background: white; padding: 20px; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-item { display: flex; align-items: center; gap: 6px; }
.search-item select, .search-item input { padding: 10px 14px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 14px; min-width: 110px; transition: border-color 0.2s; background: white; }
.search-item select:focus, .search-item input:focus { outline: none; border-color: var(--wx-green); }
.btn { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.2s; font-weight: 500; }
.btn-primary { background: var(--wx-green); color: white; }
.btn-primary:hover { background: var(--wx-green-dark); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #e04444; }
.btn-secondary { background: #f0f0f0; color: var(--text); }
.btn-secondary:hover { background: #e0e0e0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 热门标签 */
.hot-tags { background: white; padding: 15px 20px; border-radius: 12px; margin-bottom: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.hot-tags-title { font-size: 14px; color: var(--text-light); margin-bottom: 10px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--wx-green-light); color: var(--wx-green-dark); padding: 6px 14px; border-radius: 20px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.tag:hover { background: var(--wx-green); color: white; }
.tag .count { background: rgba(0,0,0,0.1); padding: 0 6px; border-radius: 10px; font-size: 11px; margin-left: 4px; }

/* 时间轴 */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--wx-green); }
.date-group { margin-bottom: 30px; }
.date-header { display: flex; align-items: center; margin-bottom: 15px; position: relative; }
.date-header::before { content: ''; position: absolute; left: -24px; width: 12px; height: 12px; background: var(--wx-green); border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 2px var(--wx-green); }
.date-header h2 { font-size: 16px; color: var(--wx-green-dark); background: var(--wx-green-light); padding: 6px 16px; border-radius: 20px; }
.date-header .count { margin-left: 10px; color: var(--text-light); font-size: 13px; }

/* 产品网格 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 15px; }
.product-card { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: all 0.2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

/* 图片容器 */
.product-image-wrap { position: relative; width: 100%; height: 180px; background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%); overflow: hidden; cursor: zoom-in; }
.product-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s, opacity 0.5s ease-out; opacity: 0; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; pointer-events: auto; }
.product-image.loaded { opacity: 1; }
.product-image-wrap:hover .product-image { transform: scale(1.05); }
.product-image-wrap::after { content: '🔍'; position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.6); color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px; opacity: 0; transition: opacity 0.2s; }
.product-image-wrap:hover::after { opacity: 1; }

/* 懒加载占位符动画 */
.product-image-wrap::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; z-index: 0; }
.product-image.loaded + .product-image-wrap::before, .product-image-wrap:has(.loaded)::before { display: none; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* 懒加载图片样式 */
.lazy-image { position: relative; z-index: 1; }

.product-info { padding: 12px; }
.product-price-row { display: flex; align-items: baseline; justify-content: space-between; }
.product-price { font-size: 22px; font-weight: bold; color: var(--danger); }
.product-price::before { content: '¥'; font-size: 14px; }
.product-price.sold { text-decoration: line-through; color: #999; }
.product-status { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.status-selling { background: var(--wx-green-light); color: var(--wx-green); }
.status-sold { background: #FFF0F0; color: var(--danger); }
.product-meta { margin-top: 8px; font-size: 13px; color: var(--text-light); display: flex; flex-wrap: wrap; gap: 8px; }
.product-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.product-tag { background: #f5f5f5; padding: 2px 8px; border-radius: 4px; font-size: 12px; color: #666; }
.product-update-info { margin-top: 8px; font-size: 11px; color: #aaa; border-top: 1px dashed #eee; padding-top: 6px; }
.share-btn { cursor: pointer; color: var(--wx-green); margin-left: 8px; }
.share-btn:hover { color: var(--wx-green-dark); }

/* 管理员操作 */
.admin-actions { display: none; padding: 10px; border-top: 1px solid #f0f0f0; gap: 6px; }
.admin-actions.show { display: flex; }
.admin-actions .btn { flex: 1; padding: 8px 10px; font-size: 12px; }

/* 加载更多 */
.load-more { text-align: center; padding: 30px; }
.load-more .btn { min-width: 200px; padding: 12px 30px; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); }
.empty-state i { font-size: 48px; display: block; margin-bottom: 15px; }

/* 页脚 */
.footer { background: #333; color: #999; padding: 30px 20px; margin-top: 40px; text-align: center; }
.footer-content { max-width: 800px; margin: 0 auto; }
.footer p { margin: 8px 0; font-size: 14px; }
.footer a { color: #ccc; text-decoration: none; }
.footer a:hover { color: var(--wx-green); }

/* 弹窗 */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-content { background: white; padding: 25px; border-radius: 16px; width: 90%; max-width: 450px; max-height: 85vh; overflow-y: auto; position: relative; z-index: 201; }
.modal-header { font-size: 18px; font-weight: 600; margin-bottom: 20px; text-align: center; }
.modal-body input, .modal-body select { width: 100%; padding: 12px; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 12px; font-size: 14px; background: white; color: #333; }
.modal-body label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
.modal-body .checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.modal-body .checkbox-group label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 14px; color: #333; margin-bottom: 0; }
.modal-body .checkbox-group input { width: auto; margin-bottom: 0; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 15px; }

/* 图片预览弹窗 */
.lightbox { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.95); z-index: 300; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 95%; max-height: 90%; object-fit: contain; border-radius: 8px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; color: white; font-size: 32px; cursor: pointer; }
.lightbox-info { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); color: white; padding: 10px 20px; border-radius: 8px; text-align: center; }

/* 回收站面板 */
.trash-panel { display: none; position: fixed; top: 0; right: 0; width: 380px; height: 100%; background: white; box-shadow: -5px 0 25px rgba(0,0,0,0.15); z-index: 150; flex-direction: column; }
.trash-panel.show { display: flex; }
.trash-header { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.trash-header h3 { font-size: 16px; }
.trash-content { flex: 1; overflow-y: auto; padding: 15px; }
.trash-item { display: flex; gap: 12px; padding: 12px; background: #f9f9f9; border-radius: 10px; margin-bottom: 10px; }
.trash-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.trash-item .info { flex: 1; }
.trash-item .info h4 { font-size: 14px; margin-bottom: 4px; }
.trash-item .info p { font-size: 12px; color: var(--text-light); }
.trash-item .actions { display: flex; flex-direction: column; gap: 5px; }
.trash-item .actions .btn { padding: 5px 10px; font-size: 12px; }

/* 管理员面板 */
.admin-panel { display: none; position: fixed; top: 0; right: 0; width: 450px; height: 100%; background: white; box-shadow: -5px 0 25px rgba(0,0,0,0.15); z-index: 150; flex-direction: column; }
.admin-panel.show { display: flex; }
.admin-panel-header { padding: 15px 20px; border-bottom: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; }
.admin-panel-content { flex: 1; overflow-y: auto; padding: 15px; }
.admin-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: #f9f9f9; border-radius: 10px; margin-bottom: 10px; }
.admin-item .info { flex: 1; }
.admin-item .info h4 { font-size: 14px; margin-bottom: 4px; }
.admin-item .info p { font-size: 12px; color: var(--text-light); }
.admin-item .actions { display: flex; gap: 5px; }
.admin-item .actions .btn { padding: 5px 10px; font-size: 12px; }
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.role-super { background: var(--wx-green-light); color: var(--wx-green-dark); }
.role-normal { background: #f0f0f0; color: #666; }

/* 提示 */
.toast { position: fixed; top: 80px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.85); color: white; padding: 12px 24px; border-radius: 8px; z-index: 400; display: none; font-size: 14px; }
.toast.show { display: block; }

/* 加载动画 */
.loading { text-align: center; padding: 40px; color: var(--text-light); }
.loading i { font-size: 32px; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 768px) {
    .navbar-nav { display: none; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .search-row { flex-direction: column; align-items: stretch; }
    .search-item { width: 100%; }
    .search-item select, .search-item input { width: 100%; }
    .trash-panel, .admin-panel { width: 100%; }
}
