/* General Body and Container Styles */
body {
    margin: 0;
    font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', 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 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.header-top-bar {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 10px 0;
    font-size: 0.85em;
}

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

.welcome-message {
    margin-right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

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

.top-nav-links a {
    color: #ecf0f1;
    text-decoration: none;
}

.top-nav-links a:hover {
    color: #007bff;
    text-decoration: none;
}

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

.navbar-brand .logo img {
    vertical-align: middle;
    max-width: 100%;
    height: auto;
}

.main-navigation {
    flex-grow: 1;
    margin-left: 30px;
}

.main-navigation .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-start;
}

.main-navigation .nav-item {
    position: relative;
    margin-right: 30px;
}

.main-navigation .nav-item:last-child {
    margin-right: 0;
}

.main-navigation .nav-item a {
    display: block;
    padding: 10px 0;
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.main-navigation .dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 220px;
    z-index: 1000;
    border-top: 3px solid #007bff;
    border-radius: 4px;
    left: 0;
    top: 100%; /* Position below the parent item */
}

.main-navigation .nav-item.dropdown:hover > .dropdown-menu,
.user-profile .user-menu.dropdown:hover > .dropdown-menu {
    display: block;
}

.main-navigation .dropdown-menu li a {
    padding: 10px 20px;
    color: #555;
    white-space: nowrap;
    font-weight: 400;
}

.main-navigation .dropdown-menu li a:hover {
    background-color: #f0f2f5;
    color: #007bff;
}

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

.search-box {
    display: flex;
}

.search-input {
    border: 1px solid #ced4da;
    padding: 9px 15px;
    border-radius: 20px 0 0 20px;
    outline: none;
    font-size: 0.9em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: 180px;
}

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

.search-button {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    padding: 9px 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-size: 0.9em;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-btn, .signup-btn {
    background-color: #007bff;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.9em;
    white-space: nowrap;
}

.login-btn:hover, .signup-btn:hover {
    background-color: #0056b3;
    text-decoration: none;
    transform: translateY(-1px);
}

.user-menu.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    display: block;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.user-avatar:hover {
    border-color: #007bff;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-menu .dropdown-menu {
    right: 0;
    left: auto;
    min-width: 160px;
}

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: #333;
    margin-left: 20px;
    padding: 5px;
}

/* Footer Styles */
.main-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 60px 0 30px;
    font-size: 0.9em;
    position: relative;
}

.footer-widgets {
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-widgets .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.footer-widgets .col-md-4,
.footer-widgets .col-md-3,
.footer-widgets .col-md-2 {
    padding: 0 15px;
    flex: 0 0 auto;
    width: 100%; /* Default for mobile */
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .footer-widgets .col-md-4 { width: 33.3333%; }
    .footer-widgets .col-md-3 { width: 25%; }
    .footer-widgets .col-md-2 { width: 16.6667%; }
}

.footer-widget h3 {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 25px;
    position: relative;
    font-weight: 600;
}

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

.footer-widget p {
    margin-bottom: 15px;
    color: rgba(236, 240, 241, 0.8);
}

.footer-widget .read-more {
    color: #007bff;
    font-weight: 500;
}

.footer-widget .read-more:hover {
    text-decoration: underline;
}

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

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

.footer-widget ul li a {
    color: rgba(236, 240, 241, 0.8);
    transition: color 0.3s ease;
}

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

.footer-widget address p {
    margin-bottom: 12px;
    line-height: 1.8;
    color: rgba(236, 240, 241, 0.8);
}

.footer-widget address i {
    margin-right: 10px;
    color: #007bff;
    width: 20px;
    text-align: center;
}

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

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

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

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

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

.newsletter-signup p {
    font-size: 0.85em;
    margin-bottom: 15px;
}

.newsletter-signup form {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.newsletter-signup input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    outline: none;
    min-width: 180px;
}

.newsletter-signup button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.newsletter-signup button:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.footer-bottom {
    padding-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom a:hover {
    color: #007bff;
    text-decoration: underline;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .main-navigation {
        display: none; /* Hide main nav on smaller screens */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        border-top: 1px solid #eee;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation .nav-list {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-navigation .nav-item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #eee;
    }

    .main-navigation .nav-item:last-child {
        border-bottom: none;
    }

    .main-navigation .nav-item a {
        padding: 12px 20px;
    }

    .main-navigation .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #eee;
        padding-left: 20px;
        background-color: #f9f9f9;
        min-width: unset;
    }

    .header-actions {
        margin-left: auto; /* Push actions to the right */
        gap: 10px;
    }

    .search-box {
        display: none; /* Hide search box on smaller screens, can be toggled via JS */
    }

    .login-btn, .signup-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }

    .mobile-menu-toggle {
        display: block; /* Show toggle button */
        margin-left: 15px;
    }

    .top-bar-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .top-nav-links {
        justify-content: center;
    }
    .top-nav-links li {
        margin: 0 10px;
    }
}

@media (max-width: 767px) {
    .header-main-nav .container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .navbar-brand {
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    .header-actions {
        flex-basis: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    .user-profile .login-btn,
    .user-profile .signup-btn {
        margin: 0 5px;
    }
    .mobile-menu-toggle {
        order: -1; /* Move toggle to the left */
        margin-right: auto;
        margin-left: 0;
    }
    .footer-widgets .col-md-4,
    .footer-widgets .col-md-3,
    .footer-widgets .col-md-2 {
        width: 100%;
        text-align: center;
    }
    .footer-widget h3::after {
        margin-left: auto;
        margin-right: auto;
    }
    .social-links {
        justify-content: center;
    }
    .newsletter-signup form {
        justify-content: center;
    }
    .newsletter-signup input[type="email"] {
        width: 100%;
        margin-bottom: 10px;
    }
    .newsletter-signup button {
        width: 100%;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
