/* Basic Resets & Global Styles */
:root {
    --primary-color: #0056b3;
    --secondary-color: #007bff;
    --accent-color: #28a745;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --bg-light: #f4f7f6;
    --bg-dark: #212529;
    --border-color: #dee2e6;
    --font-family-sans: 'Roboto', sans-serif;
    --font-family-serif: 'Georgia', serif;
    --header-height: 80px;
    --top-bar-height: 40px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #004085;
    border-color: #004085;
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    border-color: var(--accent-color);
}

.btn-secondary:hover {
    background-color: #218838;
    border-color: #218838;
}

/* Header Styles */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 8px 0;
    font-size: 0.9em;
}

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

.top-links a {
    color: var(--light-text-color);
    margin-left: 20px;
}

.top-links a:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.header-main-nav {
    padding: 15px 0;
}

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

.site-logo img {
    height: 40px;
    width: auto;
}

.primary-navigation .nav-list {
    display: flex;
    align-items: center;
}

.nav-item {
    position: relative;
    margin-left: 30px;
}

.nav-link {
    display: block;
    padding: 10px 0;
    color: var(--text-color);
    font-weight: bold;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: var(--secondary-color);
    text-decoration: none;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    border-radius: 5px;
    padding: 10px 0;
}

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

.dropdown-menu li {
    margin: 0;
}

.dropdown-link {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    white-space: nowrap;
}

.dropdown-link:hover {
    background-color: var(--bg-light);
    color: var(--secondary-color);
    text-decoration: none;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 11;
}

.menu-toggle .icon-bar {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-color);
    cursor: pointer;
    padding: 0;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-form {
    display: flex;
    width: 100%;
}

.search-form input {
    flex-grow: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1.2em;
    outline: none;
}

.search-submit-btn {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    border: none;
    padding: 15px 25px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.3s ease;
}

.search-submit-btn:hover {
    background-color: var(--primary-color);
}

.close-search-overlay {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--light-text-color);
    font-size: 28px;
    cursor: pointer;
}

/* Footer Styles */
.main-footer {
    background-color: var(--bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 50px 0 20px;
    font-size: 0.95em;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-logo img {
    height: 35px;
    width: auto;
    margin-bottom: 20px;
}

.about-text {
    margin-bottom: 25px;
}

.footer-heading {
    color: var(--light-text-color);
    font-size: 1.2em;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-nav-list li {
    margin-bottom: 10px;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
}

.footer-link:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    color: var(--light-text-color);
    font-size: 1.3em;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--light-text-color);
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.contact-info p i {
    margin-right: 10px;
    color: var(--secondary-color);
    font-size: 1.1em;
    line-height: 1.6;
}

.newsletter-signup {
    margin-top: 30px;
}

.newsletter-heading {
    color: var(--light-text-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.newsletter-form {
    display: flex;
    border-radius: 5px;
    overflow: hidden;
}

.newsletter-form input {
    border: none;
    padding: 12px 15px;
    flex-grow: 1;
    outline: none;
    font-size: 0.9em;
}

.newsletter-form .btn-secondary {
    border-radius: 0;
    padding: 12px 20px;
    font-size: 0.9em;
}

.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.bottom-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.copyright {
    margin: 0;
    font-size: 0.85em;
}

.secondary-footer-nav {
    display: flex;
    gap: 20px;
}

.secondary-footer-nav li a {
    font-size: 0.85em;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .primary-navigation .nav-list {
        display: none; /* Hide desktop menu */
        flex-direction: column;
        position: absolute;
        top: calc(var(--header-height) + var(--top-bar-height)); /* Adjust based on header height */
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 20px 0;
        z-index: 9;
    }

    .primary-navigation .nav-list.active {
        display: flex;
    }

    .nav-item {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--bg-light);
    }

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

    .nav-link {
        padding: 15px 20px;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        background-color: var(--bg-light);
        padding: 0;
        border-radius: 0;
        margin-left: 20px;
        border-top: 1px solid var(--border-color);
    }

    .nav-item.has-dropdown:hover .dropdown-menu {
        display: block; /* Ensure dropdowns are visible when parent is hovered/focused */
    }

    .dropdown-link {
        padding: 10px 30px;
    }

    .menu-toggle {
        display: block; /* Show mobile menu toggle */
    }

    .header-actions {
        order: 1; /* Move actions before nav on mobile */
    }

    .site-logo {
        order: 2;
        flex-grow: 1;
        text-align: center;
    }

    .primary-navigation {
        order: 3;
    }

    .top-bar-content {
        justify-content: center;
        text-align: center;
    }

    .top-message {
        margin-bottom: 10px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .social-links {
        justify-content: center;
    }

    .contact-info p {
        justify-content: center;
    }

    .bottom-bar-content {
        flex-direction: column;
        text-align: center;
    }

    .secondary-footer-nav {
        margin-top: 15px;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
    }
    .top-links {
        margin-top: 10px;
    }
    .top-links a {
        margin: 0 10px;
    }
}

@media (max-width: 576px) {
    .header-main-nav {
        padding: 10px 0;
    }
    .site-logo img {
        height: 35px;
    }
    .btn {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .search-form input {
        padding: 10px 15px;
        font-size: 1em;
    }
    .search-submit-btn {
        padding: 10px 18px;
        font-size: 1em;
    }
    .close-search-overlay {
        font-size: 24px;
        top: -35px;
    }
    .footer-grid {
        gap: 20px;
    }
    .newsletter-form {
        flex-direction: column;
    }
    .newsletter-form input, .newsletter-form .btn-secondary {
        border-radius: 5px;
        margin-bottom: 10px;
        width: 100%;
    }
    .newsletter-form .btn-secondary {
        margin-bottom: 0;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@media (max-width: 768px) {
  .page-content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-content {
    overflow-x: hidden;
    max-width: 100%;
  }
  body {
    overflow-x: hidden;
  }
}
