/* Basic Reset & Body */
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 {
    text-decoration: none;
    color: #007bff;
}
a:hover {
    text-decoration: underline;
    color: #0056b3;
}
ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
    color: #333;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
}
.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
.btn-secondary:hover {
    color: #fff;
    background-color: #545b62;
    border-color: #545b62;
}

/* Header Styles */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.header-top-bar {
    background-color: #333;
    color: #fff;
    padding: 10px 0;
    font-size: 0.9rem;
}
.header-top-bar .top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-top-bar .contact-info span {
    margin-right: 20px;
}
.header-top-bar .contact-info i {
    margin-right: 5px;
}
.header-top-bar .social-links a {
    color: #fff;
    margin-left: 15px;
    font-size: 1.1rem;
}
.header-top-bar .social-links a:hover {
    color: #007bff;
}

.header-main-nav {
    padding: 15px 0;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}
.navbar-brand .logo-img {
    height: 40px;
    margin-right: 10px;
}
.navbar-brand .brand-text {
    display: none; /* Hide text logo on small screens, show image */
}
@media (min-width: 768px) {
    .navbar-brand .brand-text {
        display: inline;
    }
}

.navbar-toggler {
    display: none; /* Hidden by default for larger screens */
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 0.25rem;
}
.navbar-toggler .toggler-icon {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.navbar-collapse {
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%; /* Take full width on small screens */
    order: 2; /* Put below brand and toggler on small screens */
    margin-top: 10px;
}
.navbar-nav {
    display: flex;
    margin-left: auto;
    margin-right: 20px;
    flex-direction: column; /* Stack on small screens */
    width: 100%;
}
.nav-item {
    position: relative;
    margin-bottom: 5px;
}
.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    font-weight: 500;
}
.nav-link:hover {
    color: #007bff;
    text-decoration: none;
}
.dropdown-menu {
    display: none;
    position: static; /* For mobile, stack vertically */
    background-color: #f8f9fa;
    box-shadow: none;
    border: none;
    padding: 0;
    margin-top: 0;
}
.dropdown-item {
    display: block;
    padding: 0.5rem 1.5rem;
    color: #333;
}
.dropdown-item:hover {
    background-color: #e9ecef;
}
.navbar-actions {
    display: flex;
    flex-direction: column; /* Stack on small screens */
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}
.navbar-actions .btn {
    width: 100%;
}

@media (min-width: 992px) { /* Adjust breakpoint as needed for desktop */
    .navbar-toggler {
        display: none;
    }
    .navbar-collapse {
        display: flex !important; /* Force display on desktop */
        flex-direction: row;
        width: auto;
        order: initial;
        margin-top: 0;
    }
    .navbar-nav {
        flex-direction: row;
        width: auto;
        margin-left: auto;
        margin-right: 20px;
    }
    .nav-item {
        margin-bottom: 0;
    }
    .nav-item:not(:last-child) {
        margin-right: 15px;
    }
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 160px;
        z-index: 1000;
        background-color: #fff;
        border: 1px solid rgba(0,0,0,.15);
        border-radius: 0.25rem;
        box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
    }
    .nav-item.dropdown:hover .dropdown-menu {
        display: block;
    }
    .navbar-actions {
        flex-direction: row;
        width: auto;
        margin-top: 0;
    }
    .navbar-actions .btn {
        width: auto;
    }
}

@media (max-width: 991.98px) { /* Adjust breakpoint to match JS */
    .navbar-toggler {
        display: block; /* Show toggler on small screens */
        order: 1; /* Keep it near the brand */
    }
    .navbar-collapse {
        display: none; /* Hide by default on small screens */
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        order: 3; /* Push below brand and toggler */
    }
    .navbar-collapse.show-mobile-menu {
        display: flex; /* Show when toggled */
    }
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .nav-item {
        width: 100%;
    }
    .nav-item:not(:last-child) {
        margin-right: 0;
    }
    .nav-link {
        padding: 10px 15px;
        border-bottom: 1px solid #eee;
    }
    .dropdown-menu {
        position: static; /* Stack dropdown items */
        display: none; /* Hide by default, shown by JS click */
        background-color: #f0f0f0;
        border: none;
        box-shadow: none;
        margin-left: 15px; /* Indent dropdown items */
    }
    .dropdown-item {
        padding-left: 30px;
    }
    .navbar-actions {
        flex-direction: column;
        width: 100%;
        margin-top: 15px;
        padding-bottom: 10px;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }
    .navbar-actions .btn {
        width: calc(100% - 30px); /* Adjust for padding */
        margin: 5px 15px;
    }
}

/* Footer Styles */
.main-footer {
    background-color: #222;
    color: #bbb;
    padding: 50px 0 20px;
    font-size: 0.9rem;
}
.main-footer a {
    color: #eee;
}
.main-footer a:hover {
    color: #007bff;
    text-decoration: none;
}
.footer-widgets {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 30px;
}
.footer-widget {
    flex: 1 1 22%; /* Approx 4 columns */
    margin-bottom: 30px;
    min-width: 250px; /* Ensure some minimum width for small screens */
}
@media (max-width: 768px) {
    .footer-widget {
        flex: 1 1 45%; /* 2 columns on medium screens */
    }
}
@media (max-width: 480px) {
    .footer-widget {
        flex: 1 1 100%; /* 1 column on small screens */
    }
}
.footer-widget h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1rem;
}
.footer-widget ul li {
    margin-bottom: 10px;
}
.footer-widget .social-icons a {
    display: inline-block;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    background-color: #444;
    color: #fff;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}
.footer-widget .social-icons a:hover {
    background-color: #007bff;
}
.newsletter-form input[type="email"] {
    width: calc(100% - 80px);
    padding: 8px 10px;
    border: none;
    border-radius: 3px;
    margin-right: 5px;
}
.newsletter-form button {
    padding: 8px 15px;
    border-radius: 3px;
    border: none;
    background-color: #007bff;
    color: #fff;
    cursor: pointer;
}
.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 20px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.footer-bottom p {
    margin: 0;
}
.footer-nav-bottom {
    display: flex;
    gap: 15px;
}
.footer-nav-bottom li a {
    color: #bbb;
}
.footer-nav-bottom li a:hover {
    color: #007bff;
}

/* Back to top button */
#back-to-top {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position */
    bottom: 30px; /* Place at the bottom */
    right: 30px; /* Place at the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: #007bff; /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 10px; /* Rounded corners */
    font-size: 18px; /* Increase font size */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease;
}
#back-to-top:hover {
    background-color: #0056b3;
}

/* Font Awesome (assuming it's loaded externally or via CDN) */
/* You'd typically link <link rel="stylesheet" href="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;
  }
}
