* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
}

.ai-btn-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
    font-size: 14px;
    padding: 10px 20px;
}

.ai-btn-header:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    transform: translateY(-3px);
}

.ai-btn-header i {
    font-size: 1.2em;
    margin-right: 5px;
}

.content {
    padding: 40px;
    text-align: center;
}

.product-card, .product-header, .product-info {
    text-align: left;
}

@media (min-width: 1200px) {
    .header {
        padding: 40px;
    }
    
    .header h1 {
        font-size: 32px;
    }
    
    .header p {
        font-size: 18px;
    }
    
    .content {
        padding: 50px;
    }
}

.status-message {
    margin-bottom: 30px;
}

.status-message h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 15px;
}

/* 供需切换标签样式 */
.供需切换标签 {
    display: flex;
    justify-content: center;
    margin: 0 auto 30px;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 4px;
    max-width: 400px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab {
    padding: 12px 40px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.15s ease;
    border-radius: 46px;
    background: transparent;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.tab:hover {
    color: #1e3c72;
    background: rgba(30, 60, 114, 0.05);
}

.tab.active {
    color: white;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
    transform: translateY(-1px);
}

.tab.active:hover {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
}

/* 供应信息图标样式 */
.supply-icon {
    display: inline-block;
    background-color: #2ecc71;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}

.status-message p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
    text-align: left;
    min-height: 400px; /* 添加最小高度，防止切换时页面高度变化 */
    width: 100%; /* 确保宽度始终为100% */
}

/* 产品列表容器样式 */
#productListContainer {
    min-height: 400px; /* 添加最小高度，防止切换时页面高度变化 */
    width: 100%; /* 确保宽度始终为100% */
    max-width: 1200px; /* 与容器最大宽度保持一致 */
    margin: 0 auto; /* 居中显示 */
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-info {
    flex: 1;
    overflow: hidden;
}

.product-info img {
    max-width: 100%;
    height: auto;
    max-height: 150px;
    object-fit: contain;
    margin: 8px 0;
}

.product-detail {
    margin: 8px 0;
    overflow: hidden;
}

.product-detail p {
    margin: 8px 0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

/* 添加点击反馈效果 */
.product-card:active {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    transition: all 0.1s ease;
}

/* 为可点击卡片添加光标样式 */
.product-card {
    cursor: pointer;
}

/* 限制内容节选显示为3行 */
.product-body-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* 添加平滑过渡效果 */
#productsList, #productListContainer, .status-message, #loading {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 隐藏时的状态 */
#productsList.hidden, #productListContainer.hidden, .status-message.hidden, #loading.hidden {
    opacity: 0;
    visibility: hidden;
}

/* 显示时的状态 */
#productsList.visible, #productListContainer.visible, .status-message.visible, #loading.visible {
    opacity: 1;
    visibility: visible;
}

.product-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.product-title {
    color: #1e3c72;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.demand-icon {
    display: inline-block;
    background-color: #ff4757;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: bold;
}

.product-type {
    display: inline-block;
    background: #eef5ff;
    color: #1e3c72;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
}

.product-info p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
}

.product-info strong {
    color: #333;
    display: inline-block;
    width: 80px;
}

.product-actions {
    margin-top: 15px;
    text-align: left;
}

.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    margin-right: 10px;
}

.pagination-btn {
    padding: 8px 12px;
    font-size: 14px;
    margin: 0 2px;
    background: #f0f5ff;
    color: #1e3c72;
}

.pagination-btn:hover:not(:disabled) {
    background: #1e3c72;
    color: white;
}

.pagination-btn.current {
    background: #1e3c72;
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 10px;
    flex-wrap: nowrap;
    position: relative;
}

@media (max-width: 767px) {
    .search-container {
        gap: 5px;
        margin: 20px 5px;
    }
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
    box-sizing: border-box;
}

.search-btn {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.clear-btn {
    background: linear-gradient(135deg, #888 0%, #666 100%);
}

.toggle-mode-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.ai-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

.ai-btn:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
    transform: translateY(-3px);
}

.ai-btn i {
    font-size: 1.2em;
    margin-right: 5px;
}

/* 搜索输入框包装器 */
.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    white-space: nowrap;
}

.search-suggestions ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-suggestions li {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.search-suggestions li:last-child {
    border-bottom: none;
}

.search-suggestions li:hover {
    background-color: #f5f5f5;
    color: #1e3c72;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 107, 0.6);
    }
    100% {
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    }
}

.loading {
    display: none;
    text-align: center;
    margin: 10px 0;
    padding: 15px;
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 加载文字 */
.loading p {
    color: rgba(0, 0, 0, 0.5);
    font-size: 14px;
    margin: 0;
}

/* 滚动加载更多的提示 */
.loading-more {
    text-align: center;
    padding: 10px;
    margin: 5px 0;
    color: rgba(0, 0, 0, 0.5);
    font-size: 13px;
    display: none;
}

/* 加载成功的提示 */
.loading-success {
    text-align: center;
    padding: 10px;
    margin: 5px 0;
    color: rgba(0, 0, 0, 0.5);
    font-size: 13px;
    display: none;
}

.footer {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 14px;
    border-top: 1px solid #eee;
    background-color: #fafafa;
}

@media (max-width: 768px) {
    .header {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header h1 {
        font-size: 22px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .header p {
        font-size: 14px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    
    .ai-btn-header {
        font-size: 13px;
        padding: 8px 16px;
    }
    
    .content {
        padding: 25px;
    }
    
    .status-message h2 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header p {
        font-size: 14px;
    }
    
    .content {
        padding: 20px;
    }
    
    .status-message h2 {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .search-input {
        margin-bottom: 0;
    }
    
    .product-card {
        padding: 15px;
    }
    
    .product-info p {
        font-size: 13px;
    }
    
    .product-title {
        font-size: 16px;
    }
}

/* 模态窗口样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

.modal-content {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: white;
    border-radius: 0;
    overflow: hidden;
}

.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #1e3c72;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #1e3c72;
}

.modal-body {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal-loading .spinner {
    border: 4px solid rgba(30, 60, 114, 0.1);
    border-top: 4px solid #1e3c72;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.modal-loading p {
    color: #1e3c72;
    font-size: 16px;
    margin: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 产品总数提示样式 */
.product-total-count {
    background: #eef5ff;
    color: #1e3c72;
    padding: 10px 15px;
    border-radius: 5px;
    margin: 15px 0;
    text-align: center;
    font-size: 14px;
    border-left: 4px solid #1e3c72;
    animation: fadeInSlideDown 0.3s ease;
}

.product-total-count strong {
    color: #ff6b6b;
    font-weight: bold;
}

@keyframes fadeInSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 产品内容包装器样式 */
.product-content-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px;
}

/* 标签切换遮罩层样式 */
.tab-switching-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeInBlur 0.4s ease;
    backdrop-filter: blur(8px);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-switching-content {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: scaleInBounce 0.5s ease;
    max-width: 90%;
    width: 350px;
    position: relative;
    overflow: hidden;
}

.tab-switching-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(30, 60, 114, 0.05),
        transparent
    );
    transform: rotate(45deg);
    animation: shimmer 2s infinite;
}

.tab-switching-content .spinner {
    border: 3px solid rgba(30, 60, 114, 0.1);
    border-top: 3px solid #1e3c72;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
    position: relative;
    z-index: 1;
}

.tab-switching-content p {
    color: #1e3c72;
    font-size: 16px;
    margin: 0;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

@keyframes fadeInBlur {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    70% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* 响应式模态窗口 */
@media (max-width: 768px) {
    .modal-header h2 {
        font-size: 16px;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-body {
        top: 50px;
    }
    
    .供需切换标签 {
        max-width: 90%;
        padding: 3px;
    }
    
    .tab {
        padding: 10px 30px;
        font-size: 14px;
    }
    
    .tab-switching-content {
        padding: 30px 20px;
        margin: 0 20px;
        width: 90%;
    }
    
    .tab-switching-content .spinner {
        width: 50px;
        height: 50px;
    }
    
    .tab-switching-content p {
        font-size: 14px;
    }
}

/* 无数据提示样式 */
.no-data-message {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
    animation: fadeInSlideDown 0.3s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.no-data-message i {
    font-size: 48px;
    color: #1e3c72;
    opacity: 0.5;
    margin-bottom: 20px;
    display: block;
}

.no-data-message p {
    color: #666;
    font-size: 16px;
    margin: 10px 0;
    line-height: 1.5;
}

/* 错误提示样式 */
.error-message {
    text-align: center;
    padding: 60px 20px;
    background: #fff5f5;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #ff4757;
    animation: fadeInSlideDown 0.3s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.error-message i {
    font-size: 48px;
    color: #ff4757;
    margin-bottom: 20px;
    display: block;
}

.error-message p {
    color: #666;
    font-size: 16px;
    margin: 10px 0 20px;
    line-height: 1.5;
}

.error-message .btn {
    margin-top: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .no-data-message,
    .error-message {
        padding: 40px 15px;
        margin: 15px 0;
        min-height: 300px;
    }
    
    .no-data-message i,
    .error-message i {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .no-data-message p,
    .error-message p {
        font-size: 14px;
    }
}