/* ==========================================================================
   AgriThrough 首页 2026 新版样式（仅首页加载，所有类名以 ag- 前缀隔离）
   ========================================================================== */
:root {
    --ag-green: #2f7d32;
    --ag-green-dark: #1f5c23;
    --ag-green-soft: #eef7e6;
    --ag-lime: #a4cf3f;
    --ag-ink: #1d2b1f;
    --ag-muted: #6b7a6e;
    --ag-line: #e3e9e1;
    --ag-bg: #f7faf5;
    --ag-radius: 16px;
    --ag-shadow: 0 10px 30px rgba(31, 92, 35, .08);
}

/* 头部主色统一为品牌绿（首页内生效） */
.search-con {
    border-color: #cfe2c4 !important;
}
a.a_Search {
    background: var(--ag-green) !important;
    background-image: none !important;
}
.header .nav-show a:hover,
.header .nav-show-list a:hover {
    color: var(--ag-green);
}

.ag-home {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 0;
    box-sizing: border-box;
    color: var(--ag-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}
.ag-home *,
.ag-home *::before,
.ag-home *::after {
    box-sizing: border-box;
}
.ag-home img {
    display: block;
    max-width: 100%;
}
.ag-home a {
    color: inherit;
    text-decoration: none;
}

/* ---------- 按钮 ---------- */
.ag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 26px;
    border-radius: 10px;
    background: var(--ag-green);
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    transition: background .2s ease;
}
.ag-btn:hover {
    background: var(--ag-green-dark);
}
.ag-btn--light {
    background: #fff;
    color: var(--ag-green-dark) !important;
}
.ag-btn--light:hover {
    background: #f1f8e9;
}

/* ---------- 首屏 ---------- */
.ag-hero {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 40px;
    align-items: center;
    padding: 46px 48px;
    border: 1px solid #e2eed9;
    border-radius: 24px;
    background:
        radial-gradient(circle at 92% 8%, rgba(164, 207, 63, .25), transparent 42%),
        linear-gradient(135deg, #eef7e6 0%, #f8fcf4 55%, #e6f2da 100%);
}
.ag-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(47, 125, 50, .1);
    color: var(--ag-green-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ag-hero h1 {
    margin: 16px 0 14px;
    font-size: 38px;
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -.5px;
    color: var(--ag-ink);
}
.ag-hero-desc {
    margin: 0;
    max-width: 560px;
    color: #4c5b4f;
    font-size: 15px;
    line-height: 1.65;
}
.ag-hero-search {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 620px;
    margin-top: 26px;
    padding: 6px 6px 6px 14px;
    background: #fff;
    border: 1px solid #d9e7ce;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(31, 92, 35, .06);
}
.ag-hero-search select {
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #43503f;
    font-size: 13px;
    font-weight: 600;
    padding-right: 8px;
    border-right: 1px solid var(--ag-line);
    cursor: pointer;
}
.ag-hero-search input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    font-size: 14px;
    color: var(--ag-ink);
    background: transparent;
}
.ag-hero-search input::placeholder {
    color: #9aa79b;
}
.ag-search-btn {
    height: 44px;
    padding: 0 24px;
    border: 0;
    border-radius: 10px;
    background: var(--ag-green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease;
}
.ag-search-btn:hover {
    background: var(--ag-green-dark);
}
.ag-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 34px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}
.ag-hero-stats li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ag-hero-stats b {
    font-size: 24px;
    font-weight: 800;
    color: var(--ag-green-dark);
    letter-spacing: -.4px;
}
.ag-hero-stats span {
    font-size: 12px;
    color: var(--ag-muted);
}

.ag-hero-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 148px 148px;
    gap: 12px;
}
.ag-hero-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
    background: #dfe9d7;
    box-shadow: var(--ag-shadow);
}
.ag-hero-card:first-child {
    grid-row: span 2;
}
.ag-hero-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.ag-hero-card:hover img {
    transform: scale(1.05);
}
.ag-hero-card-info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 34px 14px 12px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(12, 26, 13, .78) 100%);
    color: #fff;
}
.ag-hero-card-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}
.ag-hero-card-price {
    font-size: 12px;
    color: #d8f0a5;
}

/* ---------- 通用区块 ---------- */
.ag-section {
    margin-top: 52px;
}
.ag-section--soft {
    padding: 34px;
    border-radius: 22px;
    background: var(--ag-bg);
}
.ag-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.ag-section-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.3px;
    color: var(--ag-ink);
}
.ag-section-head h2 a {
    color: inherit;
}
.ag-section-head h2 a:hover {
    color: var(--ag-green);
}
.ag-section-head p {
    margin: 6px 0 0;
    color: var(--ag-muted);
    font-size: 13px;
}
.ag-more {
    flex: none;
    font-size: 13px;
    font-weight: 700;
    color: var(--ag-green) !important;
    white-space: nowrap;
}
.ag-more span {
    font-size: 16px;
}
.ag-more:hover {
    color: var(--ag-green-dark) !important;
}

/* ---------- 分类卡片 ---------- */
.ag-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.ag-cat-card {
    padding: 18px;
    border: 1px solid var(--ag-line);
    border-radius: var(--ag-radius);
    background: #fff;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.ag-cat-card:hover {
    border-color: #cfe2c4;
    box-shadow: var(--ag-shadow);
    transform: translateY(-2px);
}
.ag-cat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ag-green-soft);
    color: var(--ag-green);
}
.ag-cat-name {
    display: block;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--ag-ink);
}
.ag-cat-name:hover {
    color: var(--ag-green);
}
.ag-cat-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 8px;
}
.ag-cat-links a {
    font-size: 12px;
    color: var(--ag-muted);
}
.ag-cat-links a:hover {
    color: var(--ag-green);
}

/* ---------- 产品卡片 ---------- */
.ag-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.ag-product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ag-line);
    border-radius: var(--ag-radius);
    background: #fff;
    transition: box-shadow .2s ease, transform .2s ease;
}
.ag-product-card:hover {
    box-shadow: var(--ag-shadow);
    transform: translateY(-2px);
}
.ag-product-media {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f2f5ef;
}
.ag-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.ag-product-card:hover .ag-product-media img {
    transform: scale(1.05);
}
.ag-product-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 14px;
}
.ag-product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ag-ink);
}
.ag-product-name:hover {
    color: var(--ag-green);
}
.ag-product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}
.ag-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--ag-green-dark);
}
.ag-price--ask {
    font-weight: 500;
    color: #98a49a;
}
.ag-view {
    flex: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--ag-green) !important;
}
.ag-view:hover {
    text-decoration: underline;
}

/* ---------- 国家 ---------- */
.ag-country-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.ag-country-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--ag-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ag-country-card:hover {
    border-color: #cfe2c4;
    box-shadow: var(--ag-shadow);
}
.ag-country-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ag-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ag-country-total {
    flex: none;
    font-size: 12px;
    color: var(--ag-muted);
}

/* ---------- 供应商 ---------- */
.ag-supplier-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
.ag-supplier-card {
    padding: 20px;
    border: 1px solid var(--ag-line);
    border-radius: var(--ag-radius);
    background: #fff;
    transition: box-shadow .2s ease;
}
.ag-supplier-card:hover {
    box-shadow: var(--ag-shadow);
}
.ag-supplier-top {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ag-supplier-logo {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 1px solid var(--ag-line);
    border-radius: 12px;
    background: #f8faf6;
    overflow: hidden;
}
.ag-supplier-logo img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}
.ag-supplier-info {
    min-width: 0;
}
.ag-supplier-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ag-ink);
}
.ag-supplier-name:hover {
    color: var(--ag-green);
}
.ag-supplier-loc {
    margin-top: 4px;
    font-size: 12px;
    color: var(--ag-muted);
}
.ag-supplier-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 16px;
}
.ag-supplier-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f2f5ef;
}
.ag-supplier-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.ag-supplier-thumb:hover img {
    transform: scale(1.06);
}
.ag-supplier-more {
    display: inline-block;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ag-green) !important;
}
.ag-supplier-more:hover {
    text-decoration: underline;
}

/* ---------- 分类专区 ---------- */
.ag-topic-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.ag-topic-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ag-line);
    border-radius: 14px;
    background: #fff;
    transition: box-shadow .2s ease;
}
.ag-topic-card:hover {
    box-shadow: var(--ag-shadow);
}
.ag-topic-media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f2f5ef;
}
.ag-topic-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}
.ag-topic-card:hover .ag-topic-media img {
    transform: scale(1.05);
}
.ag-topic-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
}
.ag-topic-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--ag-ink);
}
.ag-topic-name:hover {
    color: var(--ag-green);
}

/* ---------- 底部行动区 ---------- */
.ag-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 56px 0 40px;
}
.ag-cta-box {
    padding: 32px;
    border-radius: 20px;
    background: #eaf5df;
}
.ag-cta-box h2 {
    margin: 0 0 10px;
    font-size: 21px;
    font-weight: 800;
    color: var(--ag-ink);
}
.ag-cta-box p {
    margin: 0 0 20px;
    font-size: 13px;
    line-height: 1.6;
    color: #4c5b4f;
}
.ag-cta-box--dark {
    background: var(--ag-green-dark);
}
.ag-cta-box--dark h2 {
    color: #fff;
}
.ag-cta-box--dark p {
    color: #d7e8d4;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .ag-cat-grid,
    .ag-product-grid,
    .ag-country-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .ag-topic-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .ag-hero {
        padding: 36px;
        gap: 28px;
    }
    .ag-hero h1 {
        font-size: 32px;
    }
}

@media (max-width: 900px) {
    .ag-hero {
        grid-template-columns: 1fr;
        padding: 30px;
    }
    .ag-hero-gallery {
        grid-template-rows: 160px 160px;
    }
    .ag-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ag-country-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ag-topic-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .ag-supplier-grid {
        grid-template-columns: 1fr;
    }
    .ag-cta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 750px) {
    .ag-home {
        padding: 14px 12px 0;
    }
    .ag-hero {
        padding: 22px;
        border-radius: 18px;
    }
    .ag-hero h1 {
        font-size: 26px;
    }
    .ag-hero-desc {
        font-size: 14px;
    }
    .ag-hero-search {
        flex-wrap: wrap;
        padding: 10px;
    }
    .ag-hero-search select {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid var(--ag-line);
    }
    .ag-hero-search input {
        width: 100%;
        flex: 1 1 60%;
    }
    .ag-search-btn {
        flex: 1;
    }
    .ag-hero-stats {
        gap: 20px;
    }
    .ag-hero-stats b {
        font-size: 20px;
    }
    .ag-hero-gallery {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 130px 130px;
    }
    .ag-section {
        margin-top: 38px;
    }
    .ag-section--soft {
        padding: 20px;
        border-radius: 16px;
    }
    .ag-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
    .ag-section-head h2 {
        font-size: 20px;
    }
    .ag-cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .ag-product-grid {
        gap: 12px;
    }
    .ag-topic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .ag-country-grid {
        gap: 10px;
    }
    .ag-country-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 12px;
    }
    .ag-cta {
        margin: 38px 0 24px;
    }
    .ag-cta-box {
        padding: 24px;
    }
}

@media (max-width: 420px) {
    .ag-hero-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }
    .ag-product-grid {
        grid-template-columns: 1fr 1fr;
    }
    .ag-cat-grid {
        grid-template-columns: 1fr;
    }
    .ag-topic-grid {
        grid-template-columns: 1fr;
    }
}
