/* 首页现代化扁平化设计样式 */

/* CSS变量定义 */
:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --text-primary: #1a1a1a;
    --text-secondary: #595959;
    --text-muted: #8c8c8c;
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
}

/* 基础布局 */
.modern-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* 区块标题样式 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    padding-left: 16px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-more {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s;
}

.section-more:hover {
    color: var(--primary-color);
}

/* 卡片基础样式 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* 轮播区域 */
.hero-section {
    margin-bottom: var(--spacing-xl);
}

.hero-banner {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero-banner img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

/* 快捷入口 */
.quick-links {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.quick-link-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.quick-link-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.quick-link-item span {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 推荐区域 */
.recommend-section {
    display: grid;
    grid-template-columns: 0.5fr 2fr;
    gap: var(--spacing-md);
    padding-top: 10px;
    padding-bottom: 10px;
}

.recommend-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.recommend-grid-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.recommend-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

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

/* 分类导航 */
.category-nav {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s;
}

.category-item:hover {
    background: var(--primary-color);
}

.category-item:hover span {
    color: #fff;
}

.category-item i {
    font-size: 32px;
    color: var(--primary-color);
}

.category-item:hover i {
    color: #fff;
}

.category-item span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 商品卡片 */
.product-section {
    margin-bottom: var(--spacing-xl);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: var(--spacing-sm);
}

.product-name {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    height: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: var(--spacing-xs);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
}

.price-current {
    font-size: 18px;
    font-weight: 600;
    color: #ff4d4f;
}

.price-current i {
    font-size: 14px;
    font-style: normal;
}

.price-original {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: line-through;
}

/* 商家区块 */
.merchant-section {
    margin-bottom: var(--spacing-xl);
}

.merchant-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-md);
}

.merchant-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.merchant-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.merchant-name {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.merchant-goods {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .product-grid,
    .merchant-goods {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .quick-links {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .recommend-section {
        grid-template-columns: 1fr;
    }
    
    .category-nav {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .product-grid,
    .merchant-goods {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .quick-links {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-nav {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-grid,
    .merchant-goods {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .section-title {
        font-size: 20px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载状态 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ==================== 限时秒杀区块 ==================== */
.seckill-section {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-xl);
    border: 1px solid #ffe6e6;
}

.seckill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.seckill-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seckill-icon {
    font-size: 28px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.seckill-text {
    font-size: 22px;
    font-weight: 700;
    color: #ff4d4f;
    letter-spacing: 1px;
}

.seckill-status {
    font-size: 14px;
    color: #ff7875;
    background: #fff1f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.seckill-countdown {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.countdown-item {
    background: #333;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 32px;
    text-align: center;
}

.countdown-sep {
    color: #333;
    font-weight: 700;
    font-size: 16px;
}

.seckill-more {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s;
}

.seckill-more:hover {
    color: #ff4d4f;
}

.seckill-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.seckill-scroll::-webkit-scrollbar {
    display: none;
}

.seckill-list {
    display: flex;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
}

.seckill-item {
	flex-shrink: 0;
	width: 160px;
	background: var(--bg-card);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: all 0.3s ease;
	text-decoration: none;
	display: flex;
	flex-direction: column;
}

.seckill-item:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-4px);
}

.seckill-img {
	position: relative;
	width: 100%;
	height: 0;
	padding-bottom: 100%;
	overflow: hidden;
	background: var(--bg-secondary);
}

.seckill-img img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: transform 0.3s;
}

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

.seckill-info {
	padding: 10px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.seckill-name {
	font-size: 13px;
	color: var(--text-primary);
	line-height: 1.4;
	height: 36px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	margin-bottom: 6px;
	font-weight: 500;
}

.seckill-price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-bottom: 6px;
	margin-top: auto;
}

.seckill-current {
	font-size: 16px;
	font-weight: 700;
	color: #ff4d4f;
}

.seckill-original {
	font-size: 11px;
	color: var(--text-muted);
	text-decoration: line-through;
}

.seckill-progress {
	display: flex;
	align-items: center;
	gap: 6px;
}

.progress-bar {
	flex: 1;
	height: 6px;
	background: #ffe6e6;
	border-radius: 3px;
	overflow: hidden;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #ff7875, #ff4d4f);
	border-radius: 3px;
	transition: width 0.3s;
}

.progress-text {
	font-size: 11px;
	color: #ff4d4f;
	white-space: nowrap;
	font-weight: 500;
}

/* 秒杀区块 - 无活动提示 */
.seckill-empty {
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    border: 1px dashed #ddd;
}

.seckill-empty-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 14px;
    color: #999;
    margin-bottom: 20px;
}

.empty-btn {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #ff7875 0%, #ff4d4f 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

.empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 77, 79, 0.4);
    color: #fff;
}

/* 秒杀区块响应式 */
@media (max-width: 768px) {
    .seckill-item {
        width: 140px;
    }
    
    .seckill-text {
        font-size: 18px;
    }
    
    .countdown-item {
        font-size: 14px;
        padding: 3px 6px;
        min-width: 28px;
    }
    
    .seckill-empty-content {
        padding: 30px 20px;
    }
    
    .empty-icon {
        font-size: 40px;
    }
    
    .empty-text {
        font-size: 16px;
    }
    
    .seckill-info {
        padding: 8px;
    }
    
    .seckill-name {
        font-size: 12px;
        height: 32px;
    }
    
    .seckill-current {
        font-size: 14px;
    }
}
