/* ========================================
   产品列表页样式 - 杭州寺坡科技有限公司
   配色方案：科技感 + 商务简洁风
======================================== */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-blue: #1E3A8A;
    --primary-blue-dark: #1565C0;
    --primary-blue-light: #3B82F6;
    
    /* 辅助色 */
    --accent-orange: #FF6F00;
    --accent-orange-dark: #EF6C00;
    --accent-green: #26A69A;
    
    /* 背景色 */
    --bg-white: #FFFFFF;
    --bg-light-gray: #F5F5F5;
    --bg-card: #FAFAFA;
    
    /* 文字色 */
    --text-primary: #212121;
    --text-secondary: #333333;
    --text-muted: #757575;
    --text-light: #9E9E9E;
    
    /* 边框色 */
    --border-light: #E0E0E0;
    --border-medium: #BDBDBD;
    
    /* 阴影 */
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 32px rgba(0,0,0,0.2);
    
    /* 动画时间 */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light-gray);
}

/* 容器样式 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-container {
    min-height: calc(100vh - 200px);
    padding-top: 20px;
}

/* ========================================
   面包屑导航区域
======================================== */
.breadcrumb-section {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light-gray) 100%);
    padding: 30px 0 40px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition-normal);
}

.breadcrumb a:hover {
    color: var(--primary-blue);
}

.breadcrumb .separator {
    color: var(--text-muted);
    font-size: 12px;
}

.breadcrumb .current {
    color: var(--accent-orange);
    font-weight: 500;
}

.page-header {
    text-align: center;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-title i {
    color: var(--accent-orange);
    font-size: 32px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ========================================
   产品展示区域
======================================== */
.products-section {
    padding: 0 0 60px;
}

/* 工具栏样式 */
.products-toolbar {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-modes {
    display: flex;
    background: var(--bg-light-gray);
    border-radius: 10px;
    padding: 5px;
    gap: 5px;
}

.view-btn {
    background: transparent;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.view-btn:hover {
    background: rgba(30, 58, 138, 0.1);
    color: var(--primary-blue);
}

.view-btn.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: var(--shadow-light);
}

.sort-select {
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    background: var(--bg-white);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: border-color var(--transition-normal);
    min-width: 150px;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* ========================================
   产品网格布局
======================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-normal);
    position: relative;
    animation-delay: calc(var(--card-index, 0) * 0.1s);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
}

/* 产品图片区域 */
.product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-card);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.image-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 58, 138, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.product-card:hover .image-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
}

.quick-view {
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 产品标签 */
.product-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    display: inline-block;
}

.sale-badge {
    background: var(--accent-orange);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 产品信息区域 */
.product-info {
    padding: 20px;
}

.product-title {
    margin-bottom: 12px;
}

.product-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-normal);
}

.product-title a:hover {
    color: var(--primary-blue);
}

/* 价格显示 */
.product-price {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.current-price {
    color: var(--accent-orange);
    font-size: 20px;
    font-weight: 700;
}

.original-price {
    color: var(--text-muted);
    font-size: 14px;
    text-decoration: line-through;
}

.discount {
    background: var(--accent-green);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* 产品操作按钮 */
.product-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    cursor: pointer;
    flex: 1;
    justify-content: center;
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.3);
}

.btn-secondary {
    background: var(--bg-light-gray);
    color: var(--text-muted);
    border: none;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
}

.btn-secondary:hover {
    background: var(--accent-orange);
    color: white;
    transform: scale(1.1);
}

/* ========================================
   产品列表视图
======================================== */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.product-item {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow-light);
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all var(--transition-normal);
}

.product-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-medium);
}

.item-image {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-orange);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-title {
    margin: 0;
}

.item-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color var(--transition-normal);
}

.item-title a:hover {
    color: var(--primary-blue);
}

.item-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-actions {
    margin-top: 10px;
}

.item-actions .btn-primary {
    width: auto;
    flex: none;
}

/* ========================================
   产品文本视图
======================================== */
.products-text {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow-light);
    margin-bottom: 40px;
}

.text-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.text-item:last-child {
    border-bottom: none;
}

.text-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-normal);
    padding: 10px;
    border-radius: 8px;
}

.text-link:hover {
    background: var(--bg-light-gray);
    color: var(--primary-blue);
}

.text-name {
    font-weight: 500;
}

.text-price {
    color: var(--accent-orange);
    font-weight: 600;
}

/* ========================================
   无产品提示
======================================== */
.no-products {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: var(--shadow-light);
}

.no-products-content i {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.no-products-content h3 {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.no-products-content p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 16px;
}

/* ========================================
   分页容器
======================================== */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

/* ========================================
   响应式设计
======================================== */

/* 平板设备 */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .products-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
    
    .page-title {
        font-size: 28px;
    }
}

/* 手机设备 */
@media (max-width: 768px) {
    .main-container {
        padding-top: 10px;
    }
    
    .breadcrumb-section {
        padding: 20px 0 30px;
        margin-bottom: 20px;
    }
    
    .page-title {
        font-size: 24px;
        flex-direction: column;
        gap: 10px;
    }
    
    .page-title i {
        font-size: 28px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .product-card {
        border-radius: 12px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .item-image {
        width: 100px;
        height: 100px;
    }
    
    .view-modes {
        width: 100%;
    }
    
    .view-btn {
        flex: 1;
        justify-content: center;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-secondary {
        width: 100%;
        border-radius: 25px;
        height: auto;
        padding: 10px;
    }
}

/* 小屏手机 */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .product-card:hover {
        transform: translateY(-4px);
    }
    
    .current-price {
        font-size: 18px;
    }
    
    .breadcrumb {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .no-products {
        padding: 40px 20px;
    }
    
    .no-products-content i {
        font-size: 48px;
    }
}

/* ========================================
   深色模式支持（可选）
======================================== */
@media (prefers-color-scheme: dark) {
    /* 这里可以添加深色模式样式，如果需要的话 */
}

/* ========================================
   加载动画增强
======================================== */
.product-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 为每个产品卡片设置不同的延迟 */
.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }
.product-card:nth-child(9) { animation-delay: 0.9s; }
.product-card:nth-child(n+10) { animation-delay: 1s; }

/* ========================================
   滚动条美化
======================================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue-dark);
}

/* ========================================
   辅助工具类
======================================== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
