/* ==========================================================================
   惠农网风格前台主题 theme-huinong.css
   依赖 site.css 先加载，本文件仅做主题覆盖
   主色 #00A94F / 深绿 #00873F / 辅色橙 #FF6A00 / 背景 #F5F5F5
   ========================================================================== */

body {
    color: #333;
    background: #F5F5F5;
    font-size: 14px;
    line-height: 1.7;
}

.container {
    width: min(1200px, calc(100% - 32px));
}

a {
    transition: color .15s ease;
}

.site-main {
    padding: 16px 0 44px;
}

/* ---------- 头部语言切换 ---------- */
.hn-header-lang {
    margin-left: 0;
    font-size: 13px;
    flex: 0 0 auto;
}

.hn-header-lang .site-lang-select {
    height: 34px;
    padding: 0 6px;
    border: 1px solid #DDDDDD;
    border-radius: 2px;
    background: #fff;
    color: #333;
    font-size: 13px;
}

.hn-header-lang .site-lang-select:hover,
.hn-header-lang .site-lang-select:focus {
    border-color: #00A94F;
    color: #00A94F;
}

/* ---------- 头部 ---------- */
.site-header {
    position: relative;
    top: auto;
    z-index: 100;
    background: #fff;
    border-bottom: none;
    backdrop-filter: none;
}

.header-inner {
    min-height: auto;
    padding: 16px 0;
    flex-wrap: nowrap;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00A94F;
    font-size: 22px;
    font-weight: 700;
    white-space: nowrap;
}

.brand-mark {
    width: auto;
    height: auto;
    border-radius: 0;
    background: transparent;
    color: #00A94F;
    font-size: 34px;
    font-weight: 800;
    font-style: italic;
    line-height: 1;
    display: inline-block;
}

.brand-text {
    color: #00A94F;
    letter-spacing: .5px;
}

.brand:hover .brand-text,
.brand:hover .brand-mark {
    color: #00873F;
}

.site-search {
    display: flex;
    flex: 1 1 420px;
    max-width: 560px;
    margin: 0 8px;
    gap: 0;
}

.site-search input {
    width: 100%;
    height: 40px;
    border: 2px solid #00A94F;
    border-right: none;
    border-radius: 2px 0 0 2px;
    padding: 0 14px;
    font-size: 14px;
    color: #333;
    background: #fff;
}

.site-search input:focus {
    border-color: #00873F;
}

.site-search button {
    flex: 0 0 88px;
    width: 88px;
    height: 40px;
    border: none;
    border-radius: 0 2px 2px 0;
    background: #00A94F;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s ease;
}

.site-search button:hover {
    background: #00873F;
}

.hn-header-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #00A94F;
    border-radius: 2px;
    color: #00A94F;
    font-size: 13px;
    white-space: nowrap;
}

.hn-header-contact:hover {
    background: #00A94F;
    color: #fff;
}

/* ---------- 主导航 ---------- */
.site-nav-bar {
    background: #00A94F;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    overflow: visible;
    flex: initial;
}

.site-nav > a,
.site-nav .nav-item > a {
    flex: 0 0 auto;
    height: 42px;
    line-height: 42px;
    padding: 0 20px;
    color: #fff;
    font-size: 15px;
    border-bottom: none;
    white-space: nowrap;
}

.site-nav > a:hover,
.site-nav > a.active,
.site-nav .nav-item > a:hover,
.site-nav .nav-item > a.active {
    color: #fff;
    background: #00873F;
    border-bottom-color: transparent;
}

.nav-item {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-caret {
    margin: 0 10px 0 -12px;
    color: rgba(255, 255, 255, .8);
    font-size: 10px;
    pointer-events: none;
}

.nav-dropdown {
    top: 100%;
    left: 0;
    min-width: 180px;
    max-height: 380px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

.nav-dropdown a {
    padding: 9px 16px;
    border-radius: 0;
    color: #444;
    font-size: 13px;
}

.nav-dropdown a:hover {
    background: #F2FBF6;
    color: #00A94F;
}

/* ---------- 通用块 ---------- */
.breadcrumb {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb a:hover {
    color: #00A94F;
}

.hn-panel {
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
    padding: 14px;
}

.hn-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #F0F0F0;
}

.hn-section-head h2 {
    margin: 0;
    padding-left: 9px;
    border-left: 3px solid #00A94F;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
}

.hn-section-head a {
    color: #999;
    font-size: 12px;
}

.hn-section-head a:hover {
    color: #00A94F;
}

.site-ad {
    margin: 12px auto;
    text-align: center;
}

.site-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
}

.hn-top-ad {
    margin: 0 0 12px;
}

.empty {
    padding: 48px 20px;
    background: #fff;
    border: 1px dashed #DDD;
    border-radius: 3px;
    color: #999;
    font-size: 13px;
}

/* ---------- 首页 ---------- */
.hn-index-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.hn-cat-panel {
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
    overflow: hidden;
    height: fit-content;
}

.hn-cat-head {
    padding: 10px 14px;
    background: #00A94F;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.hn-cat-group {
    padding: 10px 14px;
    border-bottom: 1px dashed #EDEDED;
}

.hn-cat-group:last-child {
    border-bottom: none;
}

.hn-cat-root {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.hn-cat-root:hover {
    color: #00A94F;
}

.hn-cat-children {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.hn-cat-children a {
    color: #888;
    font-size: 12px;
}

.hn-cat-children a:hover {
    color: #00A94F;
}

.hn-cat-empty {
    padding: 24px 12px;
    border: none;
    border-radius: 0;
    font-size: 12px;
    background: #fff;
}

.hn-index-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.hn-hero {
    padding: 18px 22px;
    background: linear-gradient(135deg, #EAF8F0 0%, #F7FCF9 60%, #FFFFFF 100%);
    border: 1px solid #D9F0E3;
    border-radius: 3px;
}

.hn-hero h1 {
    margin: 0 0 6px;
    color: #00873F;
    font-size: 20px;
    line-height: 1.4;
}

.hn-hero p {
    margin: 0;
    max-width: 880px;
    color: #5B6B62;
    font-size: 13px;
    line-height: 1.7;
}

/* ---------- 文章卡片 ---------- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.article-card {
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.article-card:hover {
    transform: none;
    border-color: #CFEAD9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.article-cover {
    width: 100%;
    height: 148px;
    object-fit: cover;
    background: #EEF6F1;
}

.article-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.article-card h3 {
    margin: 0 0 6px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.article-card h3 a {
    color: #333;
}

.article-card h3 a:hover {
    color: #00A94F;
}

.article-card p {
    flex: initial;
    margin: 0 0 10px;
    color: #8A8A8A;
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .meta {
    margin-top: auto;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    color: #999;
    font-size: 12px;
}

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border-radius: 2px;
    background: #FF6A00;
    color: #fff;
    font-size: 11px;
    vertical-align: middle;
}

/* ---------- 栏目页 ---------- */
.hn-column-head {
    margin-bottom: 12px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
}

.hn-column-head h1 {
    margin: 0 0 10px;
    padding-left: 9px;
    border-left: 3px solid #00A94F;
    color: #333;
    font-size: 19px;
    line-height: 1.3;
}

.hn-column-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hn-column-tabs a {
    padding: 5px 14px;
    border: 1px solid #E8E8E8;
    border-radius: 2px;
    background: #FAFAFA;
    color: #666;
    font-size: 13px;
}

.hn-column-tabs a:hover {
    border-color: #00A94F;
    color: #00A94F;
}

.hn-column-tabs a.active {
    background: #00A94F;
    border-color: #00A94F;
    color: #fff;
}

.article-item {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.article-item:last-child {
    border-bottom: 1px solid #E8E8E8;
}

.article-item:hover {
    border-color: #CFEAD9;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.article-item h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
}

.article-item h3 a {
    color: #333;
}

.article-item h3 a:hover {
    color: #00A94F;
}

.article-item p {
    margin: 0 0 8px;
    color: #8A8A8A;
    font-size: 13px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination {
    gap: 6px;
    justify-content: center;
    padding: 16px 0 4px;
}

.pagination a,
.pagination span {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #DDD;
    border-radius: 2px;
    background: #fff;
    color: #666;
    font-size: 13px;
}

.pagination a:hover {
    border-color: #00A94F;
    color: #00A94F;
}

.pagination .current {
    background: #00A94F;
    border-color: #00A94F;
    color: #fff;
}

.pagination .disabled {
    color: #C8C8C8;
    pointer-events: none;
}

.pagination .page-info {
    border-color: transparent;
    background: transparent;
    color: #8A8A8A;
}

.pagination .page-jump {
    font-size: 13px;
    color: #8A8A8A;
}

.pagination .page-jump input {
    width: 52px;
    height: 32px;
    border: 1px solid #DDD;
    border-radius: 2px;
    background: #fff;
    color: #666;
    font-size: 13px;
    text-align: center;
    outline: none;
}

.pagination .page-jump input:focus {
    border-color: #00A94F;
}

.pagination .page-jump button {
    height: 32px;
    padding: 0 10px;
    border: 1px solid #DDD;
    border-radius: 2px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
}

.pagination .page-jump button:hover {
    border-color: #00A94F;
    color: #00A94F;
}

/* ---------- 详情页 ---------- */
.hn-article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}

.article-detail {
    padding: 22px 28px 28px;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
}

.article-detail h1 {
    margin: 0 0 12px;
    color: #222;
    font-size: 23px;
    line-height: 1.45;
}

.article-detail .meta {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #F0F0F0;
    font-size: 12px;
}

.hn-article-cover {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 18px;
    border-radius: 3px;
}

.article-content {
    color: #444;
    font-size: 14px;
    line-height: 1.9;
}

.article-content p {
    margin: 0 0 14px;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 20px 0 10px;
    color: #222;
    line-height: 1.45;
}

.article-content a {
    color: #00A94F;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
}

.article-nav {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px dashed #EEE;
    font-size: 13px;
}

.article-nav a {
    color: #666;
}

.article-nav a:hover {
    color: #00A94F;
}

.hn-article-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related {
    margin-top: 0;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
}

.related h3 {
    margin: 0 0 10px;
    padding-left: 8px;
    border-left: 3px solid #00A94F;
    color: #333;
    font-size: 15px;
    line-height: 1.2;
}

.related a {
    display: block;
    padding: 8px 0;
    border-bottom: 1px dashed #F0F0F0;
    color: #555;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related a:last-child {
    border-bottom: none;
}

.related a:hover {
    color: #00A94F;
}

.hn-related-empty {
    color: #999;
    font-size: 12px;
}

.hn-article-side .site-ad {
    margin: 0;
}

/* ---------- 留言页 ---------- */
.message-panel {
    max-width: 760px;
    margin: 0 auto;
}

.message-panel h2 {
    margin: 0 0 6px;
    padding-left: 9px;
    border-left: 3px solid #00A94F;
    color: #333;
    font-size: 20px;
}

.message-desc {
    margin: 0 0 16px;
    color: #888;
    font-size: 13px;
}

.message-form {
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
    box-shadow: none;
}

.message-field label {
    margin-bottom: 5px;
    color: #555;
    font-size: 13px;
}

.message-field input,
.message-field textarea {
    padding: 9px 11px;
    border: 1px solid #DDD;
    border-radius: 2px;
    font-size: 14px;
    color: #333;
}

.message-field input:focus,
.message-field textarea:focus {
    border-color: #00A94F;
    outline: none;
}

.message-submit {
    padding: 9px 30px;
    border-radius: 2px;
    background: #00A94F;
    font-size: 14px;
}

.message-submit:hover {
    background: #00873F;
}

.message-alert {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 2px;
    font-size: 13px;
}

.message-alert.success {
    background: #EAF8F0;
    color: #00873F;
}

.message-alert.error {
    background: #FFF3F0;
    color: #D4380D;
}

/* ---------- 404 ---------- */
.hn-404 {
    padding: 80px 20px;
    border: 1px solid #E8E8E8;
    border-radius: 3px;
    background: #fff;
}

.hn-404 h2 {
    margin: 0 0 10px;
    color: #333;
    font-size: 20px;
}

.hn-404 p {
    color: #888;
    font-size: 13px;
}

.hn-404-back a {
    color: #00A94F;
}

.hn-404-back a:hover {
    color: #00873F;
    text-decoration: underline;
}

/* ---------- 页脚 ---------- */
.site-footer {
    padding: 20px 0 26px;
    background: #fff;
    border-top: 3px solid #00A94F;
    color: #999;
    font-size: 12px;
}

.site-friend-links {
    gap: 6px 14px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #F0F0F0;
    font-size: 12px;
}

.friend-links-title {
    color: #666;
    opacity: 1;
}

.site-friend-links a:hover {
    color: #00A94F;
}

.hn-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #999;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hn-article-layout {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 10px 12px;
        padding: 12px 0;
    }

    .brand {
        flex: 1 1 auto;
        font-size: 20px;
    }

    .brand-mark {
        font-size: 30px;
    }

    .hn-header-lang {
        order: 1;
    }

    .hn-header-contact {
        order: 1;
    }

    .site-search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        margin: 0;
    }

    .hn-index-layout {
        grid-template-columns: 1fr;
    }

    .hn-cat-panel {
        position: static;
    }

    .hn-article-layout {
        grid-template-columns: 1fr;
    }

    .hn-article-side {
        order: 2;
    }

    .article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        width: calc(100% - 24px);
    }

    .site-main {
        padding: 12px 0 30px;
    }

    .site-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-caret,
    .nav-dropdown {
        display: none;
    }

    .site-nav > a,
    .site-nav .nav-item > a {
        padding: 0 14px;
        font-size: 14px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }

    .hn-hero {
        padding: 14px 16px;
    }

    .hn-hero h1 {
        font-size: 18px;
    }

    .hn-column-head {
        padding: 12px 14px;
    }

    .hn-column-head h1 {
        font-size: 17px;
    }

    .article-detail {
        padding: 18px 16px;
    }

    .article-detail h1 {
        font-size: 20px;
    }

    .article-nav {
        grid-template-columns: 1fr;
    }

    .article-nav .next {
        text-align: left;
    }

    .message-form {
        padding: 16px;
    }

    .hn-404 {
        padding: 50px 16px;
    }
}
