/* Basic Reset & Global Styles */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

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

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    color: #222;
}

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

.header-top-bar {
    background-color: #f8f9fa;
    padding: 10px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #eee;
}

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

.top-nav-links ul {
    display: flex;
}

.top-nav-links li {
    margin-left: 20px;
}

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

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

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-brand .logo {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.navbar-brand img {
    margin-right: 10px;
}

.main-navigation ul {
    display: flex;
}

.main-navigation li {
    position: relative;
    margin-left: 30px;
}

.main-navigation a {
    display: block;
    padding: 10px 0;
    color: #333;
    font-weight: bold;
}

.main-navigation a:hover {
    color: #007bff;
    text-decoration: none;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-top: 3px solid #007bff;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-weight: normal;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #007bff;
}

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

.header-actions button, .header-actions .btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 15px;
    color: #555;
}

.header-actions .btn-primary {
    background-color: #007bff;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.header-actions .btn-primary:hover {
    background-color: #0056b3;
}

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

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

.search-form {
    display: flex;
    width: 80%;
    max-width: 600px;
    position: relative;
}

.search-form input[type="text"] {
    flex-grow: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 5px 0 0 5px;
    font-size: 1.1em;
}

.search-form .btn-search {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 15px 25px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

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

.search-form .close-search {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
}

/* Footer Styles */
.main-footer {
    background-color: #222;
    color: #f4f4f4;
    padding: 40px 0 20px;
    font-size: 0.9em;
}

.footer-content {
    border-bottom: 1px solid #444;
    padding-bottom: 30px;
    margin-bottom: 20px;
}

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

.footer-col h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.footer-col p {
    margin-bottom: 10px;
    color: #ccc;
}

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

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: #007bff;
    text-decoration: none;
}

.social-links a {
    color: #fff;
    font-size: 1.5em;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #007bff;
}

.contact-info i {
    margin-right: 10px;
    color: #007bff;
}

.newsletter-form {
    display: flex;
    margin-top: 15px;
}

.newsletter-form input[type="email"] {
    border: 1px solid #555;
    padding: 10px 15px;
    border-radius: 5px 0 0 5px;
    background-color: #333;
    color: #fff;
    flex-grow: 1;
}

.newsletter-form .btn-subscribe {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.privacy-note {
    font-size: 0.8em;
    margin-top: 10px;
    color: #aaa;
}

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

.footer-bottom p {
    margin: 0;
    color: #aaa;
}

.footer-bottom a {
    color: #007bff;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    .top-nav-links ul {
        margin-top: 10px;
        justify-content: center;
    }
    .top-nav-links li {
        margin: 0 10px;
    }
    .header-main-nav .container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .navbar-brand {
        margin-bottom: 15px;
    }
    .main-navigation {
        width: 100%;
        order: 3; /* Push navigation below logo and actions */
        display: none; /* Hide by default for mobile, controlled by JS toggle */
    }
    .main-navigation.active {
        display: block;
    }
    .main-navigation ul {
        flex-direction: column;
        text-align: center;
    }
    .main-navigation li {
        margin: 0;
        border-bottom: 1px solid #eee;
    }
    .main-navigation li:last-child {
        border-bottom: none;
    }
    .dropdown-content {
        position: static;
        box-shadow: none;
        border-top: none;
        background-color: #e9e9e9;
    }
    .dropdown:hover .dropdown-content {
        display: none; /* Revert desktop hover behavior */
    }
    .dropdown.active .dropdown-content {
        display: block; /* Control dropdown with JS for mobile */
    }
    .header-actions {
        margin-left: auto;
        order: 2;
    }
    .menu-toggle {
        display: block; /* Show menu toggle button */
    }
    .search-form {
        width: 90%;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col ul {
        text-align: center;
        padding-left: 0;
    }
    .footer-col ul li {
        display: inline-block;
        margin: 0 10px 8px;
    }
    .social-links {
        margin-top: 15px;
    }
    .newsletter-form {
        flex-direction: column;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    .newsletter-form input, .newsletter-form button {
        border-radius: 5px;
        margin-bottom: 10px;
    }
    .newsletter-form button {
        margin-left: 0;
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none; /* Hide menu toggle on larger screens */
    }
}

/* Font Awesome for icons */
@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css");
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
