/* 统一搜索栏样式 */
:root {
    --primary-color: #6366f1;
    --secondary-color: #f1f5f9;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* 搜索容器统一样式 */
.search-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 10px 15px;
    margin: 10px 15px;
    box-shadow: var(--shadow);
}

/* 搜索输入框统一样式 */
.search-input {
    border: none;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
}

.search-input::placeholder {
    color: #9ca3af;
}

/* 搜索图标样式 */
.search-icon {
    color: #6b7280;
    font-size: 1rem;
}

/* 按钮统一样式 */
.unified-btn {
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
}

.unified-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.unified-btn-primary {
    background: var(--primary-color);
    color: white;
}

.unified-btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.unified-btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* 小尺寸按钮 */
.unified-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 筛选按钮 */
.filter-btn, .hamburger-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 6px 12px;
    transition: all 0.3s ease;
}

.filter-btn:hover, .hamburger-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-container {
        margin: 8px 10px;
        padding: 8px 12px;
    }
    
    .search-input {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    .unified-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .unified-btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* 加载状态和空状态样式 */
.loading {
    text-align: center;
    padding: 40px;
    color: white;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

/* 状态筛选器样式 */
.status-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.status-filter-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.status-filter-btn:hover,
.status-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 表格样式增强 */
.unified-table {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.unified-table th {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 600;
}

.unified-table td {
    border: none;
    padding: 10px 12px;
    vertical-align: middle;
}

.unified-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* 卡片样式增强 */
.unified-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.unified-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.unified-card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-color);
}

/* 图片优化样式 */
img {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

img[data-src] {
    opacity: 0;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    background-size: 400% 400%;
    animation: loading-shimmer 1.5s ease-in-out infinite;
}

img.loading {
    opacity: 0.7;
    filter: blur(2px);
}

img.loaded {
    opacity: 1;
    filter: none;
}

img.error {
    opacity: 0.6;
    filter: grayscale(100%);
    cursor: pointer;
}

img.error:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* 图片加载动画 */
@keyframes loading-shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 图片容器优化 */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.product-image.loading::before {
    opacity: 1;
    animation: loading-shimmer 1.5s ease-in-out infinite;
}

/* 图片错误重试提示 */
.image-retry-hint {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.product-image.error:hover .image-retry-hint {
    opacity: 1;
}

/* 通用页面布局 */
.page-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding-bottom: 80px;
}

.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 响应式网格 */
.unified-grid {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.unified-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.unified-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.unified-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .unified-grid-2,
    .unified-grid-3,
    .unified-grid-4 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .unified-grid-3,
    .unified-grid-4 {
        grid-template-columns: 1fr 1fr;
    }
}

/* 表单样式增强 */
.unified-form-group {
    margin-bottom: 20px;
}

.unified-form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.unified-form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    font-size: 14px;
}

.unified-form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: white;
}

/* 警告和成功消息样式 */
.unified-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin: 15px 0;
    font-weight: 500;
}

.unified-alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.unified-alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.unified-alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.unified-alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}
