/* Basic Reset & Base Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --header-bg: #ffffff;
    --footer-bg: #343a40;
    --footer-text: #adb5bd;
    --border-color: #dee2e6;
    --container-max-width: 1200px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

/* Header Styles */
.main-header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    background-color: #f0f0f0;
    padding: 10px 0;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-color);
}

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

.top-nav-list {
    display: flex;
    gap: 20px;
}

.top-nav-link {
    color: var(--text-color);
}

.header-actions {
    display: flex;
    gap: 10px;
}

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

.logo img {
    display: block;
    height: 40px; /* Adjust as needed */
    width: auto;
}

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

.mobile-menu-toggle .icon-bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.main-nav-list {
    display: flex;
    gap: 30px;
}

.main-nav .nav-link {
    display: block;
    padding: 10px 0;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.main-nav .nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-item.has-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--header-bg);
    box-shadow: 0 4px 8px 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: 2px solid var(--primary-color);
}

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

.dropdown-menu li a {
    padding: 10px 15px;
    display: block;
    color: var(--text-color);
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

.header-search {
    display: flex;
    align-items: center;
}

.header-search form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.header-search input[type="search"] {
    border: none;
    padding: 8px 12px;
    font-size: 1em;
    outline: none;
    flex-grow: 1;
}

.header-search button {
    background-color: var(--primary-color);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.header-search button .icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Footer Styles */
.main-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0 20px;
    font-size: 0.9em;
}

.main-footer a {
    color: var(--footer-text);
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
    color: #fff;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-col h3, .footer-col h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1em;
    position: relative;
    padding-bottom: 5px;
}

.footer-col h3::after, .footer-col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

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

.footer-col ul {
    margin-top: 10px;
}

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

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

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

.social-links a:hover {
    background-color: var(--primary-color);
    text-decoration: none;
}

.social-links .icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

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

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

.newsletter-signup input[type="email"] {
    border: 1px solid rgba(255,255,255,0.2);
    background-color: rgba(255,255,255,0.05);
    padding: 10px 15px;
    border-radius: 5px 0 0 5px;
    color: #fff;
    outline: none;
    flex-grow: 1;
}

.newsletter-signup input[type="email"]::placeholder {
    color: var(--footer-text);
}

.newsletter-signup .btn {
    border-radius: 0 5px 5px 0;
    padding: 10px 15px;
    white-space: nowrap;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-bottom p {
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Hide main nav by default on smaller screens */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--header-bg);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 15px 0;
        border-top: 1px solid var(--border-color);
    }

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

    .main-nav-list {
        flex-direction: column;
        gap: 0;
    }

    .main-nav .nav-item {
        border-bottom: 1px solid var(--border-color);
    }

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

    .main-nav .nav-link {
        padding: 12px 20px;
        width: 100%;
    }

    .nav-item.has-dropdown .dropdown-menu {
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        border-top: none;
        padding-left: 20px;
        background-color: #f8f8f8;
    }

    .mobile-menu-toggle {
        display: block;
    }

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

    .header-search {
        order: 3; /* Move search below logo/toggle */
        width: 100%;
        margin-top: 15px;
    }
    
    .header-search form {
        width: 100%;
    }

    .header-top-bar .container {
        flex-direction: column;
        gap: 10px;
    }

    .top-nav {
        width: 100%;
        text-align: center;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }
}

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

    .footer-col h3::after, .footer-col h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

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

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