/* 用户端样式 - 企业商务简洁风格 */
:root {
    --primary-color: #1e3b5a;
    --accent-color: #f39c12;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", Arial, Helvetica, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 搜索区域 */
.search-section {
    background-color: var(--primary-color);
    padding: 15px 0;
}

.search-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    background-color: rgba(255,255,255,0.95);
    height: 40px;
}

.search-input:focus {
    outline: none;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.3);
}

.search-btn {
    padding: 10px 24px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.3s;
    height: 40px;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-btn:hover {
    background-color: #e67e22;
}

/* Banner轮播 */
.banner-section {
    background-color: var(--card-bg);
    padding: 20px 0;
}

.banner-slider {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
}

.banner-slide {
    display: none;
}

.banner-slide.active {
    display: block;
}

.banner-slide img {
    width: 100%;
    max-height: 400px;
    height: auto;
    object-fit: contain;
    background: #f5f5f5;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: var(--accent-color);
}

/* 公司信息区域 */
.company-section {
    background-color: var(--card-bg);
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-top: 20px;
}

.company-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.company-logo {
    max-width: 120px;
    max-height: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.company-name {
    font-size: 26px;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

/* 四大金刚位 */
.four-kings-section {
    padding: 10px 0;
    background-color: var(--bg-color);
}

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

.king-card {
    background-color: var(--card-bg);
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.king-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.king-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.king-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
}

/* 公司相关区域 */
.company-related-section {
    padding: 5px 0 10px;
    background-color: var(--bg-color);
}

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

.related-card {
    background-color: var(--card-bg);
    padding: 25px 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.related-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.related-title {
    font-size: 14px;
    color: var(--text-light);
}

/* 产品区域 */
.products-section {
    padding: 10px 0;
    background-color: var(--card-bg);
}

.section-title {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 20px;
    margin-top: 0; 
    text-align: center;
    font-weight: 600;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.product-image {
    width: 100%;
    max-height: 200px;
    overflow: visible;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
    display: block;
}

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

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.product-name {
    padding: 15px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 加载更多 */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.btn-load-more {
    padding: 5px 5px;
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-load-more:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-load-more:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
}

/* 页面头部 */
.page-header {
    background-color: var(--primary-color);
    padding: 20px 0;
    color: white;
}

/* .page-header .container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.page-header h1 {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 500;
} */

.page-header .container {
    position: relative;   /* 让内部绝对定位相对于此容器 */
    display: flex;
    align-items: center;
    min-height: 20px;     /* 保证有足够高度，你可以按需调整 */
}

/* .back-link {
    position: relative; 
    z-index: 2;
} */

/* 返回按钮强制白色 */
.back-link,
.back-link:visited {
    color: white;
    text-decoration: none;
}

.page-header h1 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    white-space: nowrap;  /* 如果标题很长，可以改用 max-width + 省略号 */
    text-align: center;
    z-index: 1;
}

.back-link:hover {
    background-color: rgba(255,255,255,0.1);
}

/* .page-header h1 {
    font-size: 20px;
    font-weight: 500;
    text-align: center;
} */


/* 分类页面 */
.categories-section {
    padding: 40px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.category-name {
    font-size: 18px;
    font-weight: 500;
    color: var(--primary-color);
}

/* 产品详情页 */
.product-detail-section {
    padding: 40px 0;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.product-images {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.main-image {
    width: 100%;
    max-height: 400px;
    overflow: visible;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.thumbnail-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.thumbnail {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
    background: #f5f5f5;
}

.thumbnail.active,
.thumbnail:hover {
    border-color: var(--accent-color);
}

.no-image-large {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    color: #999;
    border-radius: 8px;
}

.product-info {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.product-title {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.product-description p {
    color: var(--text-color);
    line-height: 1.8;
}

.desc-content {
    color: var(--text-color);
    line-height: 1.8;
    word-break: break-word;
}

.desc-content img.desc-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 14px 0;
    border-radius: 6px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.product-qrcode {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--bg-color);
    border-radius: 8px;
    text-align: center;
}

.product-qrcode h3 {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 15px;
}

.qrcode-container img {
    border-radius: 8px;
}

.qrcode-tip {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
}

.product-actions {
    display: flex;
    gap: 15px;
}

/* 按钮样式 */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #152a40;
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-large {
    padding: 10px 24px;
    font-size: 16px;
    flex: 1;
}

/* 搜索页面 */
.search-page-section {
    padding: 40px 0;
    background-color: var(--card-bg);
}

.search-form-large {
    display: flex;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

.search-input-large {
    flex: 1;
    padding: 15px 25px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    font-size: 18px;
    transition: border-color 0.3s;
}

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

.search-btn-large {
    padding: 15px 40px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.search-btn-large:hover {
    background-color: #e67e22;
}

.search-result {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-light);
    font-size: 16px;
}

/* 报价单 */
.quotation-section {
    padding: 40px 0;
    min-height: 400px;
}

.empty-quotation {
    text-align: center;
    padding: 60px 20px;
}

.empty-quotation p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.quotation-list {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.quotation-item {
    display: grid;
    grid-template-columns: 100px 1fr auto auto auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.quotation-item:last-child {
    border-bottom: none;
}

.quotation-item-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
    background: #f5f5f5;
}

.quotation-item-info h4 {
    font-size: 16px;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    /* border: 1px solid var(--border-color); */
    border: none;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    transition: all 0.3s;
}

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

.quantity-input {
    width: 60px;
    height: 32px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
}

.remove-btn {
    padding: 6px 6px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    width: auto;
    justify-self: center;
}

.remove-btn:hover {
    background-color: #c82333;
}

.quotation-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* 关于我们 */
.about-section {
    padding: 40px 0;
}

.about-content {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.about-logo {
    text-align: center;
    margin-bottom: 30px;
}

.about-logo img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
}

.about-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.about-text p {
    margin-bottom: 15px;
}

/* 询价表单 */
.inquiry-section {
    padding: 40px 0;
}

.inquiry-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.inquiry-form .form-group {
    margin-bottom: 25px;
}

.inquiry-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.inquiry-form input,
.inquiry-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.inquiry-form input:focus,
.inquiry-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.qr-image {
    max-width: 250px;
    border-radius: 8px;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    /* 搜索区域响应式 */
    .search-section {
        padding: 12px 0;
    }
    
    .search-form {
        gap: 8px;
        padding: 0 10px;
    }
    
    .search-input {
        padding: 8px 12px;
        font-size: 14px;
        height: 36px;
    }
    
    .search-btn {
        padding: 8px 16px;
        font-size: 14px;
        height: 36px;
    }
    
    /* 公司信息区域响应式 */
    .company-section {
        padding: 20px 0;
        margin-top: 15px;
    }
    
    .company-info {
        gap: 12px;
    }
    
    .company-logo {
        max-width: 80px;
        max-height: 45px;
    }
    
    .company-name {
        font-size: 20px;
    }
    
    .four-kings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .related-card {
        padding: 15px 10px;
    }
    
    .related-icon {
        font-size: 24px;
    }
    
    .related-title {
        font-size: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-image {
        max-height: 150px;
    }
    
    .product-detail {
        grid-template-columns: 1fr;
    }
    
    .banner-slide img {
        height: 250px;
    }
    
    .quotation-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }
    
    .quotation-item-image {
        width: 80px;
        height: 80px;
    }
    
    .search-form-large {
        flex-direction: column;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    /* 搜索区域小屏幕适配 */
    .search-section {
        padding: 10px 0;
    }
    
    .search-form {
        gap: 6px;
    }
    
    .search-input {
        padding: 6px 10px;
        font-size: 16px;
        height: 34px;
    }
    
    .search-btn {
        padding: 6px 12px;
        font-size: 13px;
        height: 34px;
    }
    
    /* 公司信息区域小屏幕适配 */
    .company-section {
        padding: 15px 0;
        margin-top: 10px;
    }
    
    .company-info {
        flex-direction: row;
        gap: 8px;
    }
    
    .company-logo {
        max-width: 70px;
        max-height: 40px;
    }
    
    .company-name {
        font-size: 18px;
    }
    
    .four-kings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .king-card {
        padding: 20px 15px;
    }
    
    .king-icon {
        font-size: 32px;
    }
    
    .king-title {
        font-size: 14px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-name {
        font-size: 13px;
        padding: 10px;
    }
}
