/* General Body & Container Styles */
body {
    margin: 0;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

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

.header-top-bar {
    background-color: #e9ecef;
    padding: 8px 0;
    font-size: 0.85em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
}

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

.top-bar-links a {
    margin-left: 20px;
    color: #6c757d;
}

.top-bar-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; /* Allow wrapping on smaller screens */
}

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

.navbar-brand .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 45px;
    margin-right: 10px;
}

.site-name {
    font-size: 1.9em;
    font-weight: 700;
    color: #343a40;
    white-space: nowrap; /* Prevent site name from wrapping */
}

.main-navigation {
    flex-grow: 1;
    text-align: center;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.nav-menu > li {
    position: relative;
    margin: 0 18px;
}

.nav-menu > li > a {
    display: block;
    padding: 10px 0;
    color: #343a40;
    font-weight: 600;
    font-size: 1.05em;
    transition: color 0.3s ease;
}

.nav-menu > li > a:hover,
.nav-menu .current-menu-item > a {
    color: #007bff;
}

.sub-menu {
    display: none;
    position: absolute;
    background-color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 10px 0;
    min-width: 220px;
    z-index: 10;
    border-radius: 6px;
    left: 0;
    top: 100%;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.menu-item-has-children:hover > .sub-menu {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: #555;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sub-menu li a:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

.menu-toggle {
    display: none; /* Hidden by default on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1010;
}

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

.header-actions {
    display: flex;
    align-items: center;
    margin-left: auto; /* Push actions to the right */
}

.search-box {
    position: relative;
    margin-right: 20px;
}

.search-input {
    border: 1px solid #ced4da;
    padding: 9px 15px;
    padding-right: 40px; /* Space for button */
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 180px;
    font-size: 0.95em;
    color: #495057;
}

.search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.search-button {
    background: none;
    border: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.search-button:hover {
    color: #007bff;
}

.user-authentication a {
    margin-left: 12px;
    padding: 9px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.login-btn {
    border: 1px solid #007bff;
    color: #007bff;
}

.login-btn:hover {
    background-color: #007bff;
    color: #fff;
}

.signup-btn {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
}

.signup-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.language-selector select {
    margin-left: 15px;
    padding: 8px 10px;
    border-radius: 5px;
    border: 1px solid #ced4da;
    background-color: #fff;
    cursor: pointer;
    font-size: 0.95em;
    color: #495057;
    appearance: none; /* Remove default arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%236c757d' d='M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.language-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.header-promo-banner {
    background-color: #fff3cd; /* Light yellow */
    color: #856404; /* Dark yellow text */
    padding: 12px 0;
    text-align: center;
    font-size: 0.98em;
    font-weight: 500;
    border-bottom: 1px solid #ffeeba;
}

.header-promo-banner strong {
    color: #a07a0a;
}

.header-promo-banner .promo-link {
    color: #007bff;
    font-weight: bold;
    text-decoration: underline;
    margin-left: 8px;
}

.header-promo-banner .promo-link:hover {
    color: #0056b3;
}

/* Footer Styles */
.main-footer {
    background-color: #212529; /* Dark background */
    color: #adb5bd; /* Light grey text */
    padding-top: 60px;
    font-size: 0.9em;
    border-top: 5px solid #007bff; /* Accent color */
}

.footer-widgets-area {
    padding-bottom: 40px;
}

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

.footer-widget h3 {
    color: #ffffff;
    font-size: 1.2em;
    margin-bottom: 20px;
    position: relative;
}

.footer-widget h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: #007bff;
    margin-top: 8px;
    border-radius: 2px;
}

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

.footer-widget ul li {
    margin-bottom: 10px;
}

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

.footer-widget ul li a:hover {
    color: #ffffff;
    text-decoration: none;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    text-decoration: none;
}

.footer-logo .logo-img {
    height: 40px;
    margin-right: 10px;
    filter: brightness(0) invert(1); /* Make logo white for dark background */
}

.footer-logo .site-name {
    color: #ffffff;
    font-size: 1.6em;
    font-weight: 700;
}

.company-description {
    margin-bottom: 20px;
    line-height: 1.8;
}

.social-links {
    margin-top: 20px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    background-color: #495057;
    color: #ffffff;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    background-color: #007bff;
    transform: translateY(-3px);
    text-decoration: none;
}

.footer-widget.widget-contact p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.footer-widget.widget-contact p i {
    margin-right: 10px;
    color: #007bff;
    font-size: 1.1em;
}

.footer-widget.widget-contact p a {
    color: #adb5bd;
}

.footer-widget.widget-contact p a:hover {
    color: #ffffff;
}

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

.newsletter-signup h4 {
    color: #ffffff;
    font-size: 1.1em;
    margin-bottom: 15px;
}

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

.newsletter-signup input[type="email"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #495057;
    border-right: none;
    outline: none;
    background-color: #343a40;
    color: #ffffff;
    font-size: 0.95em;
}

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

.newsletter-signup button {
    padding: 12px 20px;
    background-color: #007bff;
    color: #ffffff;
    border: 1px solid #007bff;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.footer-bottom-bar {
    background-color: #1a1d20;
    padding: 25px 0;
    border-top: 1px solid #343a40;
}

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

.copyright {
    color: #adb5bd;
    font-size: 0.85em;
}

.legal-links a {
    color: #adb5bd;
    margin-left: 20px;
    font-size: 0.85em;
}

.legal-links a:hover {
    color: #ffffff;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .header-main-nav .container {
        padding: 0 20px;
    }
    .nav-menu > li {
        margin: 0 12px;
    }
    .search-input {
        width: 150px;
    }
    .user-authentication a {
        padding: 8px 15px;
    }
}

@media (max-width: 992px) {
    .header-top-bar .top-bar-links {
        display: none;
    }
    .header-top-bar .top-bar-content {
        justify-content: center;
    }

    .main-navigation {
        order: 3; /* Move navigation below brand and actions */
        flex-basis: 100%;
        margin-top: 15px;
    }

    .main-navigation .nav-menu {
        display: none; /* Hide by default for mobile */
        flex-direction: column;
        background-color: #ffffff;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        position: absolute;
        width: 100%;
        left: 0;
        top: calc(100% + 1px); /* Position below header */
        padding: 10px 0;
        border-top: 1px solid #eee;
    }

    .main-navigation .nav-menu.active {
        display: flex;
    }

    .nav-menu > li {
        margin: 0;
        border-bottom: 1px solid #f8f9fa;
    }
    .nav-menu > li:last-child {
        border-bottom: none;
    }

    .nav-menu > li > a {
        padding: 12px 25px;
        text-align: left;
    }

    .sub-menu {
        position: static; /* Make sub-menu static for mobile */
        box-shadow: none;
        border-top: 1px solid #eee;
        padding-left: 30px;
        background-color: #f8f9fa;
        min-width: unset;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        margin-top: 0;
        border-radius: 0;
    }

    .menu-item-has-children:hover > .sub-menu {
        display: none; /* Override desktop hover behavior */
    }

    .menu-toggle {
        display: block; /* Show hamburger icon */
        margin-left: 20px; /* Space from other actions */
    }

    .header-actions {
        flex-grow: 1;
        justify-content: flex-end;
    }

    .search-box {
        margin-right: 10px;
    }

    .search-input {
        width: 120px;
    }

    .language-selector {
        display: none; /* Hide language selector on smaller screens */
    }

    .footer-widget-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    .footer-bottom-bar .container {
        flex-direction: column;
        text-align: center;
    }
    .legal-links {
        margin-top: 15px;
    }
    .legal-links a {
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    .navbar-brand .site-name {
        display: none; /* Hide site name to save space */
    }
    .logo-img {
        height: 38px;
    }
    .search-box {
        flex-grow: 1;
        margin-right: 0;
    }
    .search-input {
        width: 100%;
        max-width: 200px; /* Limit width */
    }
    .user-authentication {
        margin-left: 10px;
    }
    .user-authentication a {
        padding: 7px 12px;
        font-size: 0.9em;
    }
    .footer-widget-grid {
        grid-template-columns: 1fr; /* Stack widgets vertically */
        text-align: center;
    }
    .footer-widget h3::after {
        margin: 8px auto 0; /* Center underline */
    }
    .footer-logo {
        justify-content: center;
    }
    .social-links {
        display: flex;
        justify-content: center;
        margin-top: 15px;
    }
    .newsletter-signup form {
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .header-main-nav .container {
        padding: 0 10px;
    }
    .logo-img {
        height: 35px;
    }
    .search-input {
        max-width: 150px;
    }
    .user-authentication a {
        margin-left: 5px;
        padding: 6px 10px;
    }
    .menu-toggle {
        margin-left: 10px;
    }
    .header-promo-banner {
        font-size: 0.85em;
        padding: 8px 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;
  }
}
