/* General Body and Container Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header Styles */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    z-index: 100;
}

.header-top-bar {
    background-color: #f0f0f0;
    padding: 10px 0;
    font-size: 0.9em;
    color: #555;
}
.header-top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.header-top-bar .announcement {
    margin: 0;
    padding: 5px 0;
}
.header-top-bar .promo-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    margin-left: 5px;
}
.header-top-bar .promo-link:hover {
    text-decoration: underline;
}
.header-top-bar .top-nav-links a {
    margin-left: 15px;
    color: #555;
    text-decoration: none;
    transition: color 0.3s ease;
}
.header-top-bar .top-nav-links a:hover {
    color: #007bff;
}

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

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    margin-right: 20px;
}
.company-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}
.site-name {
    font-size: 1.8em;
    font-weight: bold;
    white-space: nowrap;
}

.primary-navigation {
    flex-grow: 1;
    text-align: center;
}
.primary-navigation .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}
.primary-navigation .nav-item {
    position: relative;
    margin: 0 15px;
}
.primary-navigation .nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
}
.primary-navigation .nav-link:hover,
.primary-navigation .nav-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.dropdown-icon {
    font-size: 0.8em;
    margin-left: 5px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}
.nav-item.dropdown.open .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
    z-index: 1000;
    border-radius: 4px;
    top: 100%; /* Position below the parent link */
    left: 0;
    text-align: left;
}
.nav-item.dropdown:hover .dropdown-menu,
.nav-item.dropdown.open .dropdown-menu {
    display: block;
}
.dropdown-menu li a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.dropdown-menu li a:hover {
    background-color: #f5f5f5;
    color: #007bff;
}

.header-actions {
    display: flex;
    align-items: center;
    margin-left: 20px;
}
.search-form {
    display: flex;
    margin-right: 20px;
    position: relative;
}
.search-form input[type="search"] {
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 200px;
}
.search-form input[type="search"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}
.search-button {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: -35px; /* Overlap with input for icon positioning */
    font-size: 1.2em;
    color: #555;
    padding: 0 10px;
    transition: color 0.3s ease;
}
.search-button:hover {
    color: #007bff;
}

.user-auth .btn {
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    display: inline-block;
    text-align: center;
}
.btn-secondary {
    border: 1px solid #007bff;
    color: #007bff;
    background-color: transparent;
}
.btn-secondary:hover {
    background-color: #007bff;
    color: #fff;
}
.btn-primary {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.header-bottom-info {
    background-color: #e9f7ff;
    padding: 12px 0;
    text-align: center;
    font-size: 0.95em;
    color: #0056b3;
    border-top: 1px solid #d0eaff;
}
.header-bottom-info p {
    margin: 0;
}

/* Footer Styles */
.main-footer {
    background-color: #222;
    color: #ccc;
    padding: 40px 0 20px;
    font-size: 0.9em;
    border-top: 5px solid #007bff;
}

.footer-widgets {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}
.footer-widget {
    flex: 1;
    min-width: 220px;
    margin: 0 15px 20px 0;
    padding: 10px;
}
.footer-widget:last-child {
    margin-right: 0;
}

.footer-widget h3, .footer-widget h4 {
    color: #fff;
    font-size: 1.25em;
    margin-bottom: 18px;
    border-bottom: 2px solid #444;
    padding-bottom: 8px;
    font-weight: 600;
}

.footer-widget p {
    margin-bottom: 12px;
}
.footer-widget address {
    font-style: normal;
    margin-top: 15px;
    line-height: 1.8;
}
.footer-widget address a {
    color: #007bff;
    text-decoration: none;
}
.footer-widget address a:hover {
    text-decoration: underline;
}

.footer-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-widget ul li {
    margin-bottom: 10px;
}
.footer-widget ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}
.footer-widget ul li a:hover {
    color: #007bff;
    padding-left: 5px;
}

.social-icons {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.social-icons a {
    color: #fff;
    font-size: 1.0em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #444;
    border-radius: 5px;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.social-icons a i {
    margin-right: 8px;
    font-size: 1.2em;
}
.social-icons a:hover {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.newsletter-signup {
    margin-top: 25px;
}
.newsletter-signup p {
    font-size: 0.85em;
    color: #aaa;
}
.newsletter-signup form {
    display: flex;
    margin-top: 15px;
}
.newsletter-signup input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 0.9em;
}
.newsletter-signup input[type="email"]::placeholder {
    color: #aaa;
}
.newsletter-signup .btn-subscribe {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
    font-weight: 600;
}
.newsletter-signup .btn-subscribe:hover {
    background-color: #0056b3;
}
.newsletter-note {
    font-size: 0.8em;
    margin-top: 10px;
    color: #888;
}

.footer-bottom-bar {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    color: #999;
    font-size: 0.85em;
}
.footer-bottom-bar p {
    margin-bottom: 8px;
}
.footer-bottom-bar a {
    color: #007bff;
    text-decoration: none;
}
.footer-bottom-bar a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 992px) {
    .primary-navigation {
        flex-basis: 100%;
        order: 3; /* Move navigation below logo and actions on smaller screens */
        margin-top: 15px;
    }
    .primary-navigation .nav-list {
        justify-content: flex-start;
    }
    .header-actions {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .header-top-bar .container {
        flex-direction: column;
        text-align: center;
    }
    .header-top-bar .announcement, .header-top-bar .top-nav-links {
        width: 100%;
        margin-bottom: 10px;
    }
    .header-top-bar .top-nav-links a {
        margin: 0 8px;
    }

    .header-main-nav .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .logo-link {
        margin-bottom: 15px;
        width: 100%;
        justify-content: center;
    }
    .primary-navigation {
        width: 100%;
        margin-top: 0;
        text-align: left;
    }
    .primary-navigation .nav-list {
        flex-direction: column;
        width: 100%;
        display: none; /* Hidden by default for mobile */
        border-top: 1px solid #eee;
    }
    .primary-navigation .nav-list.active {
        display: flex;
    }
    .primary-navigation .nav-item {
        margin: 0;
        border-bottom: 1px solid #eee;
        width: 100%;
    }
    .primary-navigation .nav-link {
        padding: 12px 15px;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background-color: #f9f9f9;
        border-top: 1px solid #eee;
        padding-left: 30px;
        border-radius: 0;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
        margin-top: 20px;
        margin-left: 0;
        flex-direction: column;
    }
    .search-form {
        margin-right: 0;
        margin-bottom: 15px;
        width: 90%;
        max-width: 400px;
    }
    .search-form input[type="search"] {
        width: 100%;
    }
    .user-auth {
        width: 90%;
        display: flex;
        justify-content: space-around;
    }
    .user-auth .btn {
        flex: 1;
        text-align: center;
        margin: 0 5px;
    }

    .footer-widgets {
        flex-direction: column;
        align-items: center;
    }
    .footer-widget {
        width: 100%;
        max-width: 450px;
        margin-right: 0;
        text-align: center;
        padding: 15px 0;
    }
    .footer-widget ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .social-icons {
        justify-content: center;
    }
    .newsletter-signup form {
        flex-direction: column;
        width: 90%;
        max-width: 300px;
        margin: 15px auto 0;
    }
    .newsletter-signup input[type="email"],
    .newsletter-signup .btn-subscribe {
        border-radius: 4px;
        margin-bottom: 10px;
        width: 100%;
    }
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.menu-toggle {
    display: none; /* Hidden on desktop */
    background: #007bff;
    color: #fff;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 5px;
    align-self: flex-end;
    transition: background-color 0.3s ease;
}
.menu-toggle:hover {
    background-color: #0056b3;
}
.menu-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #fff;
    border-radius: 1px;
    margin: 4px 0;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        order: 2; /* Position after logo */
        margin-top: -50px; /* Adjust to float next to logo */
    }
    .primary-navigation .nav-list {
        display: none;
    }
    .primary-navigation .nav-list.active {
        display: flex;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
