:root {
    --primary-color: #007bff; /* A vibrant blue for primary actions */
    --secondary-color: #6c757d; /* A muted grey for secondary elements */
    --accent-color: #28a745; /* A green for success/highlight */
    --text-color: #343a40; /* Dark grey for body text */
    --heading-color: #212529; /* Even darker for headings */
    --bg-light: #f8f9fa; /* Light background for sections */
    --bg-dark: #343a40; /* Dark background for header/footer */
    --border-color: #dee2e6;
    --font-family-sans: 'Helvetica Neue', Arial, sans-serif;
    --font-family-serif: 'Georgia', serif;
}

/* --- General Reset & Base Styles --- */
body {
    margin: 0;
    padding: 0;
    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;
}

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

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

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

a:hover {
    text-decoration: underline;
    color: #0056b3; /* Darker blue on hover */
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-sans);
    color: var(--heading-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 700;
}

p {
    margin-bottom: 1em;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Accessibility: Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
}

/* --- Header Styles --- */
.main-header {
    background-color: var(--bg-dark);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
}

.main-header .logo {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

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

.main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.main-nav .nav-list {
    display: flex;
    gap: 25px;
}

.main-nav .nav-link {
    color: #fff;
    padding: 10px 0;
    display: block;
    font-weight: 500;
    position: relative;
}

.main-nav .nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-nav .nav-link:hover::after, .main-nav .nav-link[aria-current="page"]::after {
    width: 100%;
}

.main-nav .has-dropdown {
    position: relative;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    background-color: var(--bg-dark);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1001;
    left: 0;
    top: 100%;
    border-top: 3px solid var(--primary-color);
    border-radius: 0 0 5px 5px;
}

.main-nav .has-dropdown:hover .dropdown-menu,
.main-nav .has-dropdown.active .dropdown-menu { /* .active class for JS toggle */
    display: block;
}

.main-nav .dropdown-menu li a {
    color: #fff;
    padding: 10px 20px;
    display: block;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav .dropdown-menu li a:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--primary-color);
    text-decoration: none;
}

.menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    order: 2; /* Position after logo, before actions on mobile */
}

.menu-toggle .icon-bar {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #fff;
    margin: 6px 0;
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* Hamburger menu animation */
.menu-toggle[aria-expanded="true"] .icon-bar:nth-child(1) { transform: rotate(-45deg) translate(-6px, 6px); }
.menu-toggle[aria-expanded="true"] .icon-bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .icon-bar:nth-child(3) { transform: rotate(45deg) translate(-6px, -6px); }

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

.search-form {
    display: flex;
    border-radius: 5px;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid #ccc;
}

.search-form input {
    border: none;
    padding: 8px 12px;
    outline: none;
    font-size: 0.9rem;
    color: var(--text-color);
}

.search-form button {
    background-color: var(--primary-color);
    border: none;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background-color: #0056b3;
}

/* --- Footer Styles --- */
.main-footer {
    background-color: var(--bg-dark);
    color: #e0e0e0;
    padding: 3.5rem 0;
    font-size: 0.9rem;
    border-top: 5px solid var(--primary-color);
}

.main-footer a {
    color: #fff;
    text-decoration: none;
}

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

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

.footer-col h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col address p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.newsletter-form {
    display: flex;
    margin-top: 1.5rem;
}

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #555;
    border-radius: 5px 0 0 5px;
    background-color: #444;
    color: #fff;
    font-size: 0.9rem;
}

.newsletter-form input[type="email"]::placeholder {
    color: #bbb;
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #0056b3;
}

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

.social-links img {
    width: 28px;
    height: 28px;
    filter: invert(1); /* Make icons white for dark background */
    transition: transform 0.3s ease, filter 0.3s ease;
}

.social-links a:hover img {
    transform: translateY(-3px) scale(1.1);
    filter: invert(0.5) sepia(1) saturate(5) hue-rotate(180deg); /* Example hover effect to primary color */
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #444;
    margin-top: 2rem;
}

.footer-bottom .back-to-top {
    margin-left: 15px;
    font-weight: 500;
    text-decoration: underline;
    display: none; /* Hidden by default, shown by JS */
}

/* --- Responsive Styles --- */
@media (max-width: 992px) {
    .main-header .container {
        flex-direction: row; /* Keep logo and toggle on one line */
        flex-wrap: wrap;
    }

    .main-header .logo {
        margin-right: auto; /* Push logo to left */
    }

    .main-nav {
        order: 3; /* Push nav below logo/toggle/actions */
        flex-basis: 100%; /* Take full width */
        justify-content: flex-start;
    }

    .main-nav .nav-list {
        display: none; /* Hide nav list by default on smaller screens */
        flex-direction: column;
        width: 100%;
        background-color: var(--bg-dark);
        position: absolute;
        top: 100%;
        left: 0;
        padding: 10px 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 999;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav .nav-list.active {
        display: flex; /* Show when active */
    }

    .main-nav .nav-item {
        width: 100%;
    }

    .main-nav .nav-link {
        padding: 12px 25px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .main-nav .nav-link:hover {
        background-color: rgba(255,255,255,0.05);
    }

    .main-nav .nav-link::after {
        display: none;
    }

    .main-nav .dropdown-menu {
        position: static; /* Make dropdown static in mobile */
        box-shadow: none;
        border-top: none;
        background-color: rgba(0,0,0,0.2); /* Slightly different background for sub-items */
        padding-left: 30px;
        border-radius: 0;
        min-width: unset;
    }

    .main-nav .dropdown-menu li a {
        padding: 10px 25px;
    }

    .menu-toggle {
        display: block; /* Show hamburger menu */
        margin-left: auto; /* Push to the right */
    }

    .header-actions {
        order: 2; /* Position after logo/toggle, before nav */
        margin-left: 0;
        gap: 10px;
    }
    .search-form {
        display: none; /* Hide search form on smaller screens, or make it a toggle */
    }
}

@media (max-width: 768px) {
    .main-header .container {
        padding: 0 10px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col h3 {
        text-align: center;
        border-bottom: none;
        padding-bottom: 0;
    }
    .newsletter-form {
        justify-content: center;
        flex-wrap: wrap;
    }
    .newsletter-form input[type="email"] {
        border-radius: 5px;
        margin-bottom: 10px;
        width: 100%;
    }
    .newsletter-form button {
        border-radius: 5px;
        width: 100%;
    }
    .social-links {
        justify-content: center;
    }
    .header-actions {
        flex-basis: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
