﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(145deg, #f0f5fe 0%, #e8f0fc 100%);
    color: #1a2c3e;
    scroll-behavior: smooth;
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #e0e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #0a4b7a, #2c7cb6);
    border-radius: 10px;
}

.app {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px 48px 32px;
}

/* 头部 */
.header {
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 32px;
    padding: 16px 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.logo-area h1 {
    font-size: 1.9rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0a4b7a 0%, #2c7cb6 50%, #ff8c42 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.logo-area p {
    font-size: 0.8rem;
    color: #ff8c42;
    margin-top: 6px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.city-selector, .login-area, .cart-icon {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #0a4b7a;
    border: 1px solid rgba(10, 75, 122, 0.15);
}

    .city-selector:hover, .login-area:hover {
        background: linear-gradient(135deg, #ff8c42, #ff6b1a);
        color: white;
        transform: translateY(-2px);
    }

.cart-icon {
    background: linear-gradient(135deg, #0a4b7a, #2c7cb6);
    color: white;
    border: none;
}

    .cart-icon:hover {
        background: linear-gradient(135deg, #ff8c42, #ff6b1a);
        transform: translateY(-2px);
    }

#cartNotify {
    background: #ff8c42;
    color: white;
    border-radius: 30px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 0.75rem;
}

/* 搜索栏 */
.filter-bar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    border-radius: 64px;
    padding: 20px 28px;
    margin-bottom: 32px;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 56px;
    padding: 6px 8px 6px 24px;
    border: 1px solid rgba(10, 75, 122, 0.12);
}

    .search-box:focus-within {
        border-color: #ff8c42;
        box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.15);
    }

    .search-box i {
        color: #ff8c42;
        margin-right: 12px;
    }

    .search-box input {
        flex: 1;
        border: none;
        background: transparent;
        padding: 14px 0;
        font-size: 1rem;
        outline: none;
        font-weight: 500;
    }

    .search-box button {
        background: linear-gradient(135deg, #0a4b7a, #2c7cb6);
        border: none;
        color: white;
        padding: 10px 32px;
        border-radius: 48px;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s ease;
    }

        .search-box button:hover {
            background: linear-gradient(135deg, #ff8c42, #ff6b1a);
            transform: scale(0.97);
        }

/* 6级分类 */
.category-row {
    width: 100%;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(10, 75, 122, 0.1);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.category-label {
    font-weight: 700;
    color: #0a4b7a;
    background: rgba(10, 75, 122, 0.08);
    padding: 8px 20px;
    border-radius: 48px;
}

.category-selects {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}

.cat-select {
    flex: 1;
    min-width: 105px;
    padding: 12px 14px;
    border-radius: 48px;
    border: 1px solid rgba(10, 75, 122, 0.15);
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
}

    .cat-select:hover {
        border-color: #ff8c42;
    }

.reset-btn {
    background: linear-gradient(135deg, #ff8c42, #ff6b1a);
    border: none;
    padding: 10px 28px;
    border-radius: 48px;
    cursor: pointer;
    color: white;
    font-weight: 700;
}

    .reset-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(255, 140, 66, 0.35);
    }

/* 导航标签 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    padding: 12px;
    border-radius: 80px;
    margin-bottom: 32px;
}

.tab-btn {
    flex: 1;
    min-width: 105px;
    background: transparent;
    border: none;
    padding: 14px 12px;
    font-weight: 600;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2c5a7a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    font-size: 0.95rem;
}

    .tab-btn.active {
        background: linear-gradient(135deg, #0a4b7a, #2c7cb6);
        color: white;
    }

    .tab-btn:not(.active):hover {
        background: rgba(255, 140, 66, 0.85);
        color: white;
    }

/* 内容区域 */
.content-area {
    min-height: 500px;
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 28px;
    margin-top: 8px;
}

/* 商品卡片 */
.product-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    overflow: hidden;
    transition: all 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    position: relative;
}

    .product-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, #0a4b7a, #ff8c42, #2c7cb6);
        border-radius: 32px 32px 0 0;
    }

    .product-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.2);
        background: white;
    }

.product-img {
    height: 170px;
    background: linear-gradient(145deg, #f0f5fe, #faf7f0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
}

.product-info {
    padding: 18px 18px 22px;
}

.product-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 1.1rem;
}

.supplier-location {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 75, 122, 0.06);
    padding: 6px 12px;
    border-radius: 40px;
    margin: 8px 0 10px 0;
    font-size: 0.7rem;
    color: #0a4b7a;
    font-weight: 500;
    width: fit-content;
}

    .supplier-location i {
        color: #ff8c42;
    }

.product-desc {
    font-size: 0.75rem;
    color: #6b85a0;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.current-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ff6b1a;
}

    .current-price small {
        font-size: 0.8rem;
        font-weight: 500;
        color: #8ba0b5;
    }

.btn-cart {
    background: linear-gradient(135deg, #0a4b7a, #2c7cb6);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 48px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

    .btn-cart:hover {
        background: linear-gradient(135deg, #ff8c42, #ff6b1a);
        transform: scale(0.96);
    }

/* 供应商卡片 */
.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.supplier-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    padding: 22px;
    border-left: 5px solid;
    transition: all 0.35s ease;
    display: flex;
    align-items: center;
    gap: 18px;
    cursor: pointer;
}

    .supplier-card.agriculture {
        border-left-color: #2e7d64;
    }

    .supplier-card.wholesale {
        border-left-color: #ff8c42;
    }

.supplier-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(145deg, #eef2fa, #e4ecf8);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.supplier-info h4 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.supplier-type {
    font-size: 0.7rem;
    padding: 4px 14px;
    border-radius: 40px;
    display: inline-block;
    font-weight: 700;
}

.type-agri {
    background: #2e7d64;
    color: white;
}

.type-wholesale {
    background: #ff8c42;
    color: white;
}

.hot-tag, .boom-tag {
    font-size: 0.65rem;
    padding: 3px 12px;
    border-radius: 40px;
    font-weight: 700;
    display: inline-block;
}

.hot-tag {
    background: linear-gradient(135deg, #ff6b1a, #ff8c42);
    color: white;
}

.boom-tag {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #8b6914;
}

.empty-msg {
    text-align: center;
    padding: 60px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 48px;
    color: #6b8aaa;
}

footer {
    margin-top: 60px;
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid rgba(10, 75, 122, 0.1);
    font-size: 0.8rem;
}

/* 模态框容器 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 75, 122, 0.4);
    backdrop-filter: blur(12px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .modal.show {
        opacity: 1;
        visibility: visible;
    }

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 48px;
    padding: 32px 28px;
    border-top: 5px solid #ff8c42;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

/* 购物车模态框稍宽 */
#cartModal .modal-content {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-content h3 {
    color: #0a4b7a;
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e8eef4;
    flex-wrap: wrap;
    gap: 12px;
}

.cart-item-info {
    flex: 2;
    min-width: 180px;
}

.cart-item-name {
    font-weight: 700;
    color: #1a2c3e;
    margin-bottom: 6px;
}

.cart-item-supplier {
    font-size: 0.7rem;
    color: #ff8c42;
    margin-bottom: 4px;
}

.cart-item-location {
    font-size: 0.65rem;
    color: #6b85a0;
}

.cart-item-spec {
    flex: 1;
    min-width: 120px;
}

    .cart-item-spec select {
        width: 100%;
        padding: 8px 12px;
        border-radius: 40px;
        border: 1px solid #cde1ef;
        background: white;
        font-size: 0.8rem;
        cursor: pointer;
    }

.cart-item-quantity {
    flex: 0.5;
    min-width: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .cart-item-quantity button {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        border: none;
        background: #eef2f8;
        cursor: pointer;
        font-weight: bold;
    }

        .cart-item-quantity button:hover {
            background: #ff8c42;
            color: white;
        }

    .cart-item-quantity span {
        min-width: 30px;
        text-align: center;
        font-weight: 600;
    }

.cart-item-price {
    flex: 0.5;
    min-width: 80px;
    text-align: right;
    font-weight: 700;
    color: #ff6b1a;
}

.cart-item-remove {
    flex: 0.2;
    text-align: center;
}

    .cart-item-remove button {
        background: none;
        border: none;
        color: #e74c3c;
        cursor: pointer;
        font-size: 1rem;
    }

.cart-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e8eef4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.cart-total {
    font-size: 1.3rem;
    font-weight: 800;
}

    .cart-total span {
        color: #ff6b1a;
        font-size: 1.6rem;
    }

.cart-actions {
    display: flex;
    gap: 12px;
}

    .cart-actions button {
        padding: 10px 24px;
        border-radius: 48px;
        border: none;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.3s ease;
    }

.btn-clear {
    background: #eef2f8;
    color: #e74c3c;
}

    .btn-clear:hover {
        background: #e74c3c;
        color: white;
    }

.btn-submit {
    background: linear-gradient(135deg, #0a4b7a, #2c7cb6);
    color: white;
}

    .btn-submit:hover {
        background: linear-gradient(135deg, #ff8c42, #ff6b1a);
        transform: scale(0.98);
    }

.close-modal {
    background: #eef2f8;
    border: none;
    padding: 10px 28px;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 500;
}

.empty-cart {
    text-align: center;
    padding: 40px;
    color: #6b85a0;
}

@media (max-width: 700px) {
    .app {
        padding: 0 16px 32px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .cart-item {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-item-price {
        text-align: left;
    }
}

/* 登录选择模态框按钮样式 */
.btn-login-choice {
    width: 100%;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

    .btn-login-choice:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

#quickLoginBtn:hover {
    background: linear-gradient(135deg, #ff8c42, #ff6b1a) !important;
    box-shadow: 0 8px 20px rgba(255, 140, 66, 0.3);
}

#accountLoginBtn:hover {
    background: #f0f5fe !important;
    border-color: #ff8c42 !important;
}

.user-logged-in {
    background: rgba(255, 140, 66, 0.15) !important;
    border-color: #ff8c42 !important;
}
