/* ========================================
   农业股资讯网 - Newspaper & Magazine Template
   Responsive CSS Styles
======================================== */

/* CSS Variables - 农业主题绿色调 */
:root {
    --primary-color: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary-color: #1a1a2e;
    --dark-color: #0f0f1e;
    --light-color: #f5f5f5;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --white: #fff;
    --black: #000;
    --transition: all 0.3s ease;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --header-bg: #1a1a2e;
    --nav-bg: #2E7D32;
    --topbar-bg: #0f0f1e;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

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

/* ========================================
   Header & Navigation
======================================== */

/* Top Bar */
.top-bar {
    background-color: var(--topbar-bg);
    color: var(--white);
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    gap: 20px;
}

.top-bar-left span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.top-bar-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

.top-bar a {
    color: var(--white);
    opacity: 0.8;
}

.top-bar a:hover {
    opacity: 1;
    color: var(--primary-light);
}

/* Language Selector */
.language-selector {
    position: relative;
    margin-left: 15px;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.language-btn:hover {
    background-color: rgba(255,255,255,0.2);
}

.language-btn i {
    font-size: 12px;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    min-width: 150px;
    box-shadow: var(--shadow);
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
    margin-top: 5px;
}

.language-selector:hover .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--text-color);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    opacity: 1;
}

.language-dropdown a:last-child {
    border-bottom: none;
}

.language-dropdown a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.language-dropdown a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.language-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

/* Main Header */
.main-header {
    background-color: var(--header-bg);
    padding: 25px 0;
    border-bottom: none;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 36px;
    font-weight: 800;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Georgia', serif;
}

.logo span {
    color: var(--primary-light);
}

.logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--white);
}

.logo-text span {
    color: var(--primary-light);
}

.header-ad {
    max-width: 728px;
    height: 90px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    border-radius: 4px;
}

/* Navigation */
.main-nav {
    background-color: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-menu {
    display: flex;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    padding: 18px 22px;
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: rgba(0,0,0,0.2);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--white);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--text-color);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    text-transform: none;
}

.dropdown-menu a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

.dropdown-menu a::after {
    display: none;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
}

.search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 3px 0 0 3px;
    width: 200px;
    font-size: 14px;
}

.search-box button {
    padding: 8px 15px;
    background-color: var(--primary-dark);
    color: var(--white);
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background-color: var(--primary-light);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 3px 0;
    transition: var(--transition);
}

/* ========================================
   Main Content Area
======================================== */
.main-content {
    min-height: 500px;
    padding-bottom: 40px;
}

/* ========================================
   Hero Section
======================================== */
.hero-section {
    padding: 30px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.hero-main {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.hero-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: var(--white);
}

.category-tag {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.hero-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.hero-content h2 a:hover {
    color: var(--primary-light);
}

.meta-info {
    display: flex;
    gap: 15px;
    font-size: 13px;
    opacity: 0.8;
}

.meta-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Hero Side */
.hero-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-side-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.hero-side-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.hero-side-item .hero-content {
    padding: 20px;
}

.hero-side-item h3 {
    font-size: 16px;
    line-height: 1.4;
}

/* ========================================
   Section Headers
======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.view-all {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

/* ========================================
   News Grid & Cards
======================================== */
.news-section {
    padding: 40px 0;
}

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

.news-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-card-img {
    position: relative;
    overflow: hidden;
}

.news-card-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

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

.news-card-img .category-tag {
    position: absolute;
    top: 15px;
    left: 15px;
}

.news-card-content {
    padding: 20px;
}

.news-card-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-card-content h3 a:hover {
    color: var(--primary-color);
}

.news-card-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* ========================================
   Two Column Layout
======================================== */
.two-column {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* Popular Posts */
.popular-post {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.popular-post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-img {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    flex-shrink: 0;
}

.popular-post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content h4 {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.popular-post-content h4 a:hover {
    color: var(--primary-color);
}

.popular-post-content .meta-info {
    font-size: 12px;
}

/* Categories Widget */
.category-list li {
    border-bottom: 1px solid var(--border-color);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    font-size: 14px;
    transition: var(--transition);
}

.category-list a:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

.category-list .count {
    background-color: var(--light-color);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags-cloud a {
    padding: 8px 15px;
    background-color: var(--light-color);
    border-radius: 20px;
    font-size: 13px;
    transition: var(--transition);
}

.tags-cloud a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ========================================
   Article List Page
======================================== */
.article-list {
    background-color: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.article-item {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.article-item-img {
    width: 280px;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-item:hover .article-item-img img {
    transform: scale(1.05);
}

.article-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-item-content .category-tag {
    align-self: flex-start;
    margin-bottom: 10px;
}

.article-item-content h3 {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-item-content h3 a:hover {
    color: var(--primary-color);
}

.article-item-content p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.article-item-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-item-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========================================
   News Detail Page
======================================== */
.news-detail {
    padding: 40px 0;
}

.article-header {
    margin-bottom: 30px;
}

.article-header .category-tag {
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 36px;
    line-height: 1.3;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.article-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
}

.article-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.article-body {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-color);
}

.article-body p {
    margin-bottom: 20px;
}

.article-body h2,
.article-body h3 {
    margin: 30px 0 15px;
    color: var(--secondary-color);
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 20px 30px;
    margin: 30px 0;
    background-color: var(--light-color);
    font-style: italic;
    font-size: 18px;
}

.article-body ul,
.article-body ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-body li {
    margin-bottom: 10px;
}

/* Article Footer */
.article-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.article-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.article-tags span {
    font-weight: 600;
    margin-right: 10px;
}

.article-tags a {
    padding: 8px 15px;
    background-color: var(--light-color);
    border-radius: 20px;
    font-size: 13px;
}

.article-tags a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-buttons span {
    font-weight: 600;
    margin-right: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-3px);
}

.share-btn.wechat { background-color: #07C160; }
.share-btn.weibo { background-color: #E6162D; }
.share-btn.qq { background-color: #12B7F5; }
.share-btn.twitter { background-color: #1da1f2; }

/* Related Posts */
.related-posts {
    margin-top: 50px;
}

.related-posts h3 {
    font-size: 24px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* ========================================
   Footer
======================================== */
.main-footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 60px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-section p {
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul a {
    color: #aaa;
    transition: var(--transition);
}

.footer-section ul a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
}

.footer-bottom p {
    color: #aaa;
    font-size: 14px;
}

/* ========================================
   Pagination
======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 18px;
    background-color: var(--white);
    border-radius: 5px;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.pagination a:hover,
.pagination .current {
    background-color: var(--primary-color);
    color: var(--white);
}

/* ========================================
   Back to Top
======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* ========================================
   Responsive Design
======================================== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-main img {
        height: 400px;
    }
    
    .hero-side {
        flex-direction: row;
    }
    
    .hero-side-item {
        flex: 1;
    }
    
    .hero-side-item img {
        height: 200px;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .two-column {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .top-bar-left {
        display: none;
    }
    
    .header-ad {
        display: none;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--secondary-color);
        flex-direction: column;
        padding: 80px 20px 20px;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(0,0,0,0.1);
        box-shadow: none;
        display: none;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .search-box {
        display: none;
    }
    
    .hero-side {
        flex-direction: column;
    }
    
    .hero-content h2 {
        font-size: 20px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .article-item {
        flex-direction: column;
    }
    
    .article-item-img {
        width: 100%;
        height: 200px;
    }
    
    .article-header h1 {
        font-size: 24px;
    }
    
    .article-image img {
        height: 250px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

@media (max-width: 480px) {
    .hero-main img {
        height: 250px;
    }
    
    .hero-content {
        padding: 15px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .section-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ========================================
   Utility Classes
======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 50px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }
.mb-5 { margin-bottom: 50px; }

.py-1 { padding-top: 10px; padding-bottom: 10px; }
.py-2 { padding-top: 20px; padding-bottom: 20px; }
.py-3 { padding-top: 30px; padding-bottom: 30px; }
.py-4 { padding-top: 40px; padding-bottom: 40px; }
.py-5 { padding-top: 50px; padding-bottom: 50px; }
