/**
 * 天人一秾农业发展有限公司 - 全站样式
 * 农业企业高端简约风格
 */

/* ========== 全局变量 ========== */
:root {
    --primary: #2e7d32;
    --primary-light: #4caf50;
    --primary-lighter: #66bb6a;
    --primary-bg: #e8f5e9;
    --accent: #f9a825;
    --dark: #1b5e20;
    --text: #333;
    --text-light: #666;
    --gray-bg: #f8f9fa;
    --white: #fff;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --radius: 8px;
}

/* ========== 基础样式 ========== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: color .3s; }
a:hover { color: var(--dark); }

/* ========== 顶部信息栏 ========== */
.top-bar {
    background: var(--dark);
    color: var(--white);
    font-size: 0.85rem;
    padding: 6px 0;
}
.top-bar i { color: var(--accent); margin-right: 5px; }

/* ========== 主导航 ========== */
.main-navbar {
    background: var(--white) !important;
    box-shadow: var(--shadow);
    padding: 10px 0;
}
.brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.main-navbar .nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text) !important;
    padding: 8px 18px !important;
    transition: color .3s;
    position: relative;
}
.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--primary) !important;
}
.main-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 18px; right: 18px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* ========== 页面Banner ========== */
.page-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}
.page-banner h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 10px; }
.page-banner .breadcrumb { justify-content: center; }
.page-banner .breadcrumb-item a { color: rgba(255,255,255,.8); }
.page-banner .breadcrumb-item.active { color: rgba(255,255,255,.6); }

/* ========== 首页Hero轮播 ========== */
.hero-carousel .carousel-item {
    height: 500px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.hero-carousel .carousel-item::before {
    content: '';
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.35);
}
.hero-carousel .carousel-caption {
    bottom: 50%;
    transform: translateY(50%);
    z-index: 2;
}
.hero-carousel .carousel-caption h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero-carousel .carousel-caption p {
    font-size: 1.2rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
@media (max-width: 768px) {
    .hero-carousel .carousel-item { height: 300px; }
    .hero-carousel .carousel-caption h2 { font-size: 1.5rem; }
    .hero-carousel .carousel-caption p { font-size: 0.9rem; }
}

/* ========== 通用Section ========== */
.section { padding: 60px 0; }
.section-title {
    text-align: center;
    margin-bottom: 40px;
}
.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    display: inline-block;
}
.section-title h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 12px auto 0;
    border-radius: 2px;
}
.section-title p { color: var(--text-light); margin-top: 10px; }
.section-alt { background: var(--primary-bg); }

/* ========== 优势卡片 ========== */
.advantage-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform .3s;
    height: 100%;
}
.advantage-card:hover { transform: translateY(-5px); }
.advantage-card .icon {
    width: 70px; height: 70px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.8rem;
    color: var(--primary);
}
.advantage-card h5 { font-weight: 600; margin-bottom: 10px; }
.advantage-card p { font-size: 0.9rem; color: var(--text-light); }

/* ========== 产品卡片 ========== */
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .3s, box-shadow .3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.product-card .card-img-wrap {
    height: 220px;
    overflow: hidden;
    position: relative;
    background: var(--gray-bg);
}
.product-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.product-card:hover .card-img-wrap img { transform: scale(1.05); }
.product-card .card-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
}
.product-card .card-body { padding: 15px; flex: 1; display: flex; flex-direction: column; }
.product-card .card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.product-card .card-text { font-size: 0.85rem; color: var(--text-light); margin-bottom: 5px; }
.product-card .card-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e53935;
    margin-top: auto;
    padding-top: 10px;
}
.product-card .card-price small { font-size: 0.75rem; font-weight: 400; color: var(--text-light); }

/* ========== 文章卡片 ========== */
.article-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .3s;
    height: 100%;
}
.article-card:hover { transform: translateY(-3px); }
.article-card .card-img-wrap {
    height: 180px;
    overflow: hidden;
    background: var(--gray-bg);
}
.article-card .card-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
}
.article-card .card-body { padding: 15px; }
.article-card .card-meta {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 8px;
}
.article-card .card-meta span { margin-right: 15px; }
.article-card .card-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.article-card .card-text { font-size: 0.85rem; color: var(--text-light); }
.article-card .badge { font-size: 0.75rem; }

/* ========== 产品详情 ========== */
.product-detail-img {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-bg);
}
.product-detail-img img { width: 100%; height: auto; border-radius: var(--radius); }
.product-info-table { width: 100%; }
.product-info-table td { padding: 10px 15px; border-bottom: 1px solid #eee; }
.product-info-table td:first-child { font-weight: 600; width: 120px; color: var(--text-light); }

/* ========== 文章详情 ========== */
.article-content { line-height: 1.8; font-size: 1rem; color: #333; }
.article-content p { margin-bottom: 15px; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 15px 0; }
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
    font-weight: 600; margin: 25px 0 12px; color: var(--dark);
}
.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.3rem; }
.article-content h4 { font-size: 1.15rem; }
.article-content ul, .article-content ol { padding-left: 24px; margin-bottom: 15px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote {
    border-left: 4px solid var(--primary); background: #f8f9fa;
    padding: 15px 20px; margin: 15px 0; color: #555; border-radius: 0 4px 4px 0;
}
.article-content table { width: 100%; border-collapse: collapse; margin: 15px 0; }
.article-content table th, .article-content table td {
    border: 1px solid #e0e0e0; padding: 10px 12px; text-align: left;
}
.article-content table th { background: var(--primary-bg); font-weight: 600; }
.article-content a { color: var(--primary); text-decoration: underline; }
.article-content pre {
    background: #f5f5f5; padding: 15px; border-radius: 4px;
    overflow-x: auto; font-size: 0.9rem; margin: 15px 0;
}
.article-content code {
    background: #f0f0f0; padding: 2px 6px; border-radius: 3px;
    font-size: 0.9em; color: #c7254e;
}
.article-content hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }
.article-meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #eee; }

/* ========== CTA区块 ========== */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}
.cta-section h2 { font-weight: 700; margin-bottom: 15px; }
.cta-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 25px; }

/* ========== 仓储网点 ========== */
.warehouse-item {
    text-align: center;
    padding: 20px 15px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.warehouse-item i { font-size: 2rem; color: var(--primary); margin-bottom: 10px; }
.warehouse-item h6 { font-weight: 600; }
.warehouse-item p { font-size: 0.85rem; color: var(--text-light); margin: 0; }

/* ========== 表单样式 ========== */
.inquiry-form .form-label { font-weight: 500; }
.inquiry-form .form-control:focus,
.inquiry-form .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(76,175,80,0.25);
}

/* ========== 按钮 ========== */
.btn-primary-custom {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 500;
    transition: all .3s;
}
.btn-primary-custom:hover {
    background: var(--dark);
    border-color: var(--dark);
    color: var(--white);
    transform: translateY(-2px);
}
.btn-outline-custom {
    border: 2px solid var(--white);
    color: var(--white);
    padding: 10px 30px;
    border-radius: 50px;
    font-weight: 500;
    transition: all .3s;
}
.btn-outline-custom:hover {
    background: var(--white);
    color: var(--primary);
}

/* ========== 关于我们 ========== */
.about-feature {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}
.about-feature .icon {
    width: 50px; height: 50px; min-width: 50px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    margin-right: 15px;
}
.about-feature h5 { font-weight: 600; margin-bottom: 5px; }
.about-feature p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

.cert-item {
    text-align: center;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.cert-item i { font-size: 2.5rem; color: var(--accent); margin-bottom: 10px; }

/* ========== 联系我们 ========== */
.contact-info-card {
    padding: 25px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    height: 100%;
}
.contact-info-card i { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; }
.contact-info-card h5 { font-weight: 600; margin-bottom: 10px; }
.contact-info-card p { font-size: 0.9rem; color: var(--text-light); }

/* ========== 底部 ========== */
.site-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.8);
    padding: 50px 0 20px;
}
.footer-title {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 1.1rem;
    position: relative;
    padding-bottom: 10px;
}
.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px; height: 2px;
    background: var(--accent);
}
.footer-text { font-size: 0.9rem; margin-bottom: 8px; }
.footer-text i { color: var(--accent); margin-right: 8px; width: 16px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.9rem; transition: color .3s; }
.footer-links a:hover { color: var(--accent); }
.footer-hr { border-color: rgba(255,255,255,0.1); margin: 30px 0 20px; }
.footer-copyright { font-size: 0.85rem; margin: 0; color: rgba(255,255,255,0.5); }
.footer-copyright a { color: rgba(255,255,255,0.5); }
.qrcode-img { width: 120px; height: 120px; border-radius: var(--radius); }
.qrcode-placeholder {
    width: 120px; height: 120px;
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: rgba(255,255,255,0.4);
}
.qrcode-placeholder p { font-size: 0.75rem; margin: 5px 0 0; }

/* ========== 筛选标签 ========== */
.filter-tabs { margin-bottom: 30px; }
.filter-tabs .btn {
    border-radius: 50px;
    padding: 6px 20px;
    margin: 0 5px 10px 0;
    font-size: 0.9rem;
}
.filter-tabs .btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}
.filter-tabs .btn-outline-primary.active,
.filter-tabs .btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

/* ========== 分页 ========== */
.pagination .page-link {
    color: var(--primary);
    border-color: #dee2e6;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ========== 后台样式 ========== */
.admin-sidebar {
    background: #1a1a2e;
    min-height: 100vh;
    padding: 0;
    position: fixed;
    top: 0; left: 0;
    width: 250px;
    z-index: 1000;
}
.admin-sidebar .brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar .brand h5 { color: var(--white); margin: 0; font-size: 1.1rem; }
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 12px 20px;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all .3s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: var(--white);
    background: rgba(255,255,255,0.05);
    border-left-color: var(--accent);
}
.admin-sidebar .nav-link i { width: 20px; margin-right: 10px; }
.admin-content {
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    background: var(--gray-bg);
}
.admin-topbar {
    background: var(--white);
    padding: 15px 20px;
    margin: -20px -20px 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-topbar h4 { margin: 0; font-weight: 600; }
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-card .number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .label { color: var(--text-light); font-size: 0.9rem; }
.admin-table { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-table table { margin: 0; }
.admin-table th { background: var(--primary-bg); font-weight: 600; font-size: 0.9rem; }
.admin-table td { font-size: 0.9rem; vertical-align: middle; }
.admin-table img.thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }

/* 后台登录页 */
.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
}
.admin-login .card {
    width: 400px;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* ========== 响应式 ========== */
@media (max-width: 992px) {
    .admin-sidebar { width: 200px; }
    .admin-content { margin-left: 200px; }
}
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    .admin-content { margin-left: 0; }
    .page-banner { padding: 40px 0; }
    .page-banner h1 { font-size: 1.5rem; }
    .section { padding: 40px 0; }
    .section-title h2 { font-size: 1.5rem; }
    .product-card .card-img-wrap { height: 180px; }
    .cta-section { padding: 40px 0; }
    .cta-section h2 { font-size: 1.5rem; }
}

/* ========== TinyMCE 富文本编辑器适配 ========== */
.tox .tox-editor-container { background: #fff; }
.tox .tox-edit-area { padding: 0 10px; }
