/* Basic Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

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

a:hover {
    text-decoration: underline;
}

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

/* Header Styles */
.site-header {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.logo-area {
    display: flex;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
}

.site-logo img {
    margin-right: 10px;
    height: 40px; /* Fixed height for logo */
    width: auto;
}

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

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

.nav-menu .menu-item {
    position: relative;
    margin-left: 25px;
}

.nav-menu .menu-item a {
    display: block;
    padding: 10px 0;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.nav-menu .menu-item-has-children > a::after {
    content: ' \25BC'; /* Down arrow */
    font-size: 0.7em;
    margin-left: 5px;
}

.sub-menu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    border-top: 3px solid #007bff;
}

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

.sub-menu .menu-item {
    margin: 0;
}

.sub-menu .menu-item a {
    padding: 10px 20px;
    white-space: nowrap;
    color: #444;
}

.sub-menu .menu-item a:hover {
    background-color: #f8f8f8;
    color: #007bff;
}

.menu-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: #333;
}

.icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    transition: all 0.3s ease;
}

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

.search-form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
}

.search-form input[type="search"] {
    border: none;
    padding: 8px 15px;
    outline: none;
    width: 180px;
}

.search-form button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.user-auth .btn {
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

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

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

/* Footer Styles */
.site-footer {
    background-color: #222;
    color: #bbb;
    padding: 50px 0 30px;
    font-size: 15px;
}

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

.footer-col h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.footer-col h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: #007bff;
    margin-top: 10px;
}

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

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

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

.footer-col ul li a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

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

.social-media a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #444;
    color: #fff;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

.social-media a:hover {
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
}

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

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.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;
}

.copyright {
    margin-top: 30px;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid #333;
    padding-top: 20px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .nav-menu {
        display: none; /* Hide desktop menu */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px; /* Adjust based on header height */
        left: 0;
        background-color: #fff;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        padding: 10px 0;
    }

    .nav-menu.active {
        display: flex; /* Show when active */
    }

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

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

    .nav-menu .menu-item a {
        padding: 12px 20px;
        color: #333;
    }

    .nav-menu .menu-item-has-children > a::after {
        float: right;
    }

    .sub-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        background-color: #f8f8f8;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none; /* Hide sub-menu by default on mobile */
        padding-left: 20px;
    }

    .nav-menu .menu-item-has-children.active > .sub-menu {
        display: block; /* Show sub-menu when parent is active */
    }

    .menu-toggle {
        display: block; /* Show hamburger icon */
        order: 2; /* Position it after logo on smaller screens */
    }

    .header-actions {
        order: 3; /* Position after menu toggle */
        width: 100%;
        justify-content: center;
        margin-top: 15px;
        margin-left: 0;
    }

    .search-form input[type="search"] {
        width: auto;
    }

    .header-container {
        justify-content: space-between;
    }

    .logo-area {
        order: 1;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col h3::after {
        margin: 10px auto 0; /* Center underline */
    }

    .social-media {
        justify-content: center;
    }

    .newsletter-form {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
