/* ========================================
   微普云产品页面 - 独立样式文件
   注意: 此文件独立于首页style.css,避免样式冲突
   ======================================== */

/* CSS变量定义 (与首页保持一致) */
:root {
    --primary: #2563eb;
    --primary-hover: #3b82f6;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --success: #10b981;
    --danger: #ef4444;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --bg-gray: #f8fafc;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
                 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-gray);
}

.products-common-top .main-content {
    margin-top: 12px;
    padding-top: 12px;
}

/* 导航栏 (复用首页样式) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    height: 70px;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.brand-logo {
    width: 36px;
    height: 36px;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0 auto;
}

.nav-menu li a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.nav-actions {
    display: flex;
    gap: 12px;
}

.btn-secondary {
    display: inline-block;
    padding: 8px 20px;
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-dark);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-large {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 48px;
}

/* 主内容区 */
.main-content {
    margin-top: 90px;
    padding: 32px 0;
}

/* 页面容器 - 左右分栏布局 */
.page-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 110px;
    height: fit-content;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 3px;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-gray);
    border: 2px solid transparent;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: var(--transition);
    user-select: none;
}

.filter-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.filter-item.active {
    background: var(--primary);
    color: var(--bg-white);
    border-color: var(--primary);
    font-weight: 500;
}

.btn-reset {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-gray);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-reset:hover {
    background: var(--bg-white);
    border-color: var(--primary);
    color: var(--primary);
}

/* 主内容区域 */
.main-area {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--bg-white);
    padding: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.toolbar-left {
    flex: 1;
}

.toolbar-right {
    flex-shrink: 0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: var(--text-tertiary);
}

.search-box input {
    width: 100%;
    padding: 10px 100px 10px 44px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-hint {
    position: absolute;
    right: 14px;
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-gray);
    padding: 3px 8px;
    border-radius: 4px;
}

.sort-select {
    padding: 10px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-white);
    cursor: pointer;
    transition: var(--transition);
    min-width: 160px;
}

.sort-select:hover,
.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 结果统计 */
.result-count {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 0 4px;
}

.result-count strong {
    color: var(--primary);
    font-weight: 600;
}

/* 产品网格 */
.products-list-stage {
    position: relative;
    min-height: 96px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.product-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-6px);
}

.product-image {
    position: relative;
    height: 160px;
    background: var(--bg-gray);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.badge-hot {
    color: #ef4444;
    background: rgba(254, 226, 226, 0.95);
}

.badge-recommend {
    color: #f59e0b;
    background: rgba(254, 243, 199, 0.95);
}

.badge-new {
    color: var(--primary);
    background: rgba(219, 234, 254, 0.95);
}

.badge-free {
    color: var(--success);
    background: rgba(209, 250, 229, 0.95);
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-meta i {
    font-size: 16px;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.product-price del {
    font-size: 14px;
    color: var(--text-tertiary);
}

.product-price strong {
    font-size: 22px;
    font-weight: 700;
    color: var(--danger);
}

.product-price strong.free {
    font-size: 18px;
    color: var(--success);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-white);
    border-radius: var(--radius);
}

.empty-state i {
    font-size: 64px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.btn-primary {
    padding: 12px 28px;
    background: var(--primary);
    color: var(--bg-white);
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
    transform: translateY(-2px);
}

/* 加载状态 */
.loading-state {
    position: fixed;
    top: auto;
    bottom: 28px;
    left: 50%;
    z-index: 5;
    padding: 10px;
    text-align: center;
    transform: translateX(-50%);
    pointer-events: none;
}

.loading-state i {
    display: block;
    font-size: 30px;
    color: var(--primary);
    margin-bottom: 6px;
}

.loading-state p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 分页器 */
.pagination-container {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

#pagination {
    display: flex;
    gap: 8px;
}

#pagination .layui-laypage a,
#pagination .layui-laypage span {
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    background: #ffffff !important;
    color: #6b7280 !important;
    font-size: 14px !important;
    line-height: 34px !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

#pagination .layui-laypage a:hover {
    border-color: #2563eb !important;
    color: #2563eb !important;
}

#pagination .layui-laypage-curr .layui-laypage-em {
    background: #2563eb !important;
    border-color: #2563eb !important;
}

.infinite-scroll-status {
    display: none;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 13px;
}

.infinite-scroll-status.is-loading::before {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    content: '';
    border: 2px solid #dbe4f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: products-loading-spin 0.7s linear infinite;
}

@keyframes products-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 页脚 */
.footer {
    background: var(--bg-gray);
    border-top: 1px solid var(--border);
    padding: 60px 0 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    padding-bottom: 40px;
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.footer-item {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 12px 0;
}

.footer-item a {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
}

.footer-item a:hover {
    color: var(--primary);
}

.footer-qq {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 8px 0;
}

.footer-qq a {
    color: var(--primary);
    text-decoration: none;
}

.footer-qq a:hover {
    color: var(--primary-hover);
}

.footer-copyright {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0;
}

.footer-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 4px 0;
}

.footer-bottom {
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.footer-bottom a {
    color: var(--text-primary);
    font-weight: 500;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--primary);
}

/* 横向筛选与精致化覆盖 */
.page-container {
    display: block;
}

.main-area {
    gap: 22px;
}

.products-hero {
    padding: 18px 20px 22px;
    margin-bottom: 24px;
    text-align: center;
}

.products-hero h1 {
    margin: 0;
    color: #303133;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.4;
}

.products-hero p {
    margin: 14px 0 0;
    color: #909399;
    font-size: 16px;
    line-height: 1.6;
}

.product-controls {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #ebeef5;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.025);
}

.filter-toolbar {
    background: #ffffff;
    border: 0;
    box-shadow: none;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    gap: 28px;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e5eaf1;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.025);
}

.toolbar-sort {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
}

.toolbar-search {
    width: 100%;
    justify-self: end;
}

.toolbar-search .search-box {
    width: 100%;
}

.toolbar .search-box input,
.toolbar .sort-select {
    height: 42px;
    border-width: 1px;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
}

.toolbar-right {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 14px;
}

.sort-label {
    flex: 0 0 auto;
    color: #606266;
    font-size: 14px;
}

.sort-options {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 24px;
}

.sort-options button {
    padding: 8px 0;
    color: #909399;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.sort-options button:hover,
.sort-options button.active {
    color: #2563eb;
}

.sort-options button.active {
    font-weight: 500;
}

.toolbar .search-box input {
    background: #f8fafc;
    padding-left: 42px;
}

.toolbar .search-box input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.toolbar .sort-select {
    min-width: 142px;
    background-color: #f8fafc;
}

.filter-toolbar {
    padding: 10px 28px 8px;
    border-radius: 0;
}

.filter-row {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 18px;
}

.filter-row + .filter-row {
    border-top: 0;
    margin-top: 2px;
}

.filter-row-inline {
    flex-wrap: wrap;
    column-gap: 28px;
    row-gap: 6px;
}

.filter-segment {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
}

.filter-segment-tags {
    flex: 1;
}

.filter-divider {
    width: 1px;
    height: 18px;
    background: #e5e7eb;
}

.filter-label {
    flex: 0 0 74px;
    color: #303133;
    font-size: 15px;
    font-weight: 400;
}

.filter-segment .filter-label {
    flex: 0 0 74px;
}

.filter-options {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 34px;
    flex-wrap: wrap;
}

.filter-options .filter-item {
    width: auto;
    min-width: 0;
    padding: 8px 0;
    color: #909399;
    font-size: 15px;
    white-space: nowrap;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    text-align: center;
}

.filter-options .filter-item:hover {
    color: #2563eb;
    background: transparent;
    border-color: transparent;
}

.filter-options .filter-item.active {
    color: #2563eb;
    font-weight: 500;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.filter-reset {
    display: inline-flex;
    height: 32px;
    padding: 0 12px;
    color: #7b8798;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
}

.filter-reset:hover {
    color: #2563eb;
    background: #f8fbff;
    border-color: #bfd4ff;
}

.product-card {
    border-color: #e7ebf1;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.035);
}

.product-card:hover {
    border-color: #c7d7f5;
    box-shadow: 0 14px 30px rgba(30, 64, 175, 0.1);
    transform: translateY(-4px);
}

.product-info {
    padding: 18px;
}

.result-count {
    flex: 0 0 auto;
    padding: 0 18px 0 0;
    border-right: 1px solid #e5e7eb;
}

/* 响应式设计 */

/* 平板 (768-1200px) */
@media (max-width: 1200px) {
    .container-large {
        padding: 0 32px;
    }

    .page-container {
        grid-template-columns: 220px 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 移动端 (<768px) */
@media (max-width: 768px) {
    .products-hero {
        padding: 16px 16px 18px;
        margin-bottom: 18px;
    }

    .products-hero h1 {
        font-size: 28px;
    }

    .products-hero p {
        margin-top: 8px;
        font-size: 14px;
    }

    .container, .container-large {
        padding: 0 16px;
    }
    
    .navbar {
        height: 60px;
    }
    
    .nav-content {
        height: 60px;
    }
    
    .brand {
        font-size: 18px;
    }
    
    .brand-logo {
        width: 32px;
        height: 32px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .main-content {
        margin-top: 76px;
        padding: 16px 0;
    }
    
    .page-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .sidebar {
        position: static;
        max-height: none;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 12px;
    }
    
    .toolbar-left,
    .toolbar-right {
        width: 100%;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .footer {
        margin-top: 40px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .filter-toolbar {
        padding: 12px 16px;
    }

    .toolbar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .toolbar-right {
        width: 100%;
        overflow: hidden;
    }

    .toolbar-sort {
        width: 100%;
        overflow: hidden;
    }

    .sort-options {
        overflow-x: auto;
        gap: 22px;
        padding: 6px 0;
        scrollbar-width: none;
    }

    .sort-options::-webkit-scrollbar {
        display: none;
    }

    .filter-row {
        min-height: 50px;
        gap: 8px;
    }

    .filter-row-inline {
        column-gap: 14px;
        row-gap: 0;
    }

    .filter-segment {
        width: 100%;
        gap: 8px;
    }

    .filter-divider {
        display: none;
    }

    .filter-label {
        flex-basis: 58px;
    }

    .filter-segment .filter-label {
        flex: 0 0 58px;
    }

    .filter-options {
        overflow-x: auto;
        padding: 7px 0;
        flex-wrap: nowrap;
        gap: 24px;
        scrollbar-width: none;
    }

    .filter-options::-webkit-scrollbar {
        display: none;
    }

    .filter-options .filter-item {
        flex: 0 0 auto;
    }

    .filter-reset {
        flex: 0 0 auto;
        padding: 0 10px;
    }
}
