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

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Common Link Styles */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

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

/* Header Styles */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header.scrolled {
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.header-top-bar {
    background-color: #f0f2f5;
    padding: 10px 0;
    font-size: 0.85em;
    color: #666;
    border-bottom: 1px solid #e7e7e7;
}

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

.welcome-message {
    margin: 0;
    padding-right: 15px;
}

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

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

.top-nav ul li:first-child {
    margin-left: 0;
}

.top-nav ul li a {
    color: #555;
    font-weight: 500;
    padding: 5px 0;
}

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

.main-header-content {
    padding: 15px 0;
}

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

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

.site-logo {
    color: #333;
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: 700;
}

.site-logo img {
    margin-right: 12px;
    max-height: 40px;
    width: auto;
}

.site-logo h1 {
    font-size: 1.8em;
    margin: 0;
    color: #333;
    letter-spacing: -0.5px;
}

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

.main-navigation .menu {
    list-style: none;
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.main-navigation .menu li {
    position: relative;
    margin-left: 35px;
}

.main-navigation .menu li a {
    color: #333;
    padding: 10px 0;
    display: block;
    font-weight: 600;
    position: relative;
}

.main-navigation .menu li a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.main-navigation .menu li a:hover::after {
    width: 100%;
}

.main-navigation .menu li a:hover {
    color: #007bff;
    text-decoration: none;
}

.main-navigation .menu-item-has-children > a::after {
    content: '▼';
    font-size: 0.6em;
    margin-left: 6px;
    vertical-align: middle;
    transition: transform 0.3s ease;
    position: static; /* Override previous ::after */
    background: none;
    height: auto;
}

.main-navigation .menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

.main-navigation .sub-menu {
    display: none;
    position: absolute;
    background-color: #ffffff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    min-width: 220px;
    top: calc(100% + 10px);
    left: 0;
    list-style: none;
    padding: 10px 0;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

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

.main-navigation .sub-menu li {
    margin: 0;
}

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

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

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

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

.search-bar {
    margin-left: 25px;
}

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

.search-bar input[type="search"] {
    padding: 10px 18px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    width: 200px;
    font-size: 0.9em;
    transition: width 0.3s ease, border-color 0.3s ease;
}

.search-bar input[type="search"]:focus {
    width: 240px;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.search-bar button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    margin-left: -45px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative;
    left: 5px;
}

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

.header-bottom-banner {
    background-color: #e6f7ff;
    padding: 12px 0;
    text-align: center;
    font-size: 0.95em;
    color: #007bff;
    border-top: 1px solid #cceeff;
    font-weight: 500;
}

.header-bottom-banner a {
    color: #0056b3;
    text-decoration: underline;
}

/* Footer Styles */
.site-footer {
    background-color: #263238;
    color: #cfd8dc;
    padding: 60px 0 30px;
    font-size: 0.9em;
}

.site-footer a {
    color: #b0bec5;
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-widgets {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #37474f;
}

.footer-widget {
    width: calc(25% - 30px); /* Four columns with spacing */
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .footer-widget {
        width: calc(50% - 20px); /* Two columns on medium screens */
    }
}

@media (max-width: 768px) {
    .footer-widget {
        width: 100%; /* Single column on small screens */
    }
}

.footer-widget h3 {
    color: #ffffff;
    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 ul {
    list-style: none;
    padding: 0;
}

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

.footer-widget p {
    margin-bottom: 18px;
    color: #cfd8dc;
}

.social-links {
    display: flex;
    margin-top: 25px;
}

.social-links li {
    margin-right: 18px;
}

.social-links a {
    font-size: 1.4em;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #37474f;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #37474f;
}

.footer-bottom p {
    margin-bottom: 15px;
    color: #b0bec5;
}

.legal-links a {
    margin: 0 12px;
    color: #b0bec5;
}

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

.heart-icon {
    color: #e57373;
    font-size: 1.1em;
    margin: 0 3px;
}

/* Responsive adjustments for header */
@media (max-width: 992px) {
    .main-header-content .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-navigation {
        width: 100%;
        text-align: left;
        margin-top: 20px;
        margin-left: 0;
        order: 3; /* Position after search bar */
    }
    .main-navigation .menu {
        flex-direction: column;
        width: 100%;
        display: none; /* Hidden by default for mobile */
        background-color: #ffffff;
        border-top: 1px solid #eee;
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    }
    .main-navigation .menu.active {
        display: flex; /* Shown when active */
    }
    .main-navigation .menu li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
    }
    .main-navigation .menu li:last-child {
        border-bottom: none;
    }
    .main-navigation .menu li a {
        padding: 15px 20px;
    }
    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        background-color: #f8f8f8;
        padding-left: 30px;
        border-top: 1px solid #e0e0e0;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        border-radius: 0;
    }
    .main-navigation .menu-item-has-children > a::after {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }
    .menu-toggle {
        display: block; /* Show hamburger on mobile */
        order: 2; /* Position after logo */
        margin-left: auto; /* Push to right */
    }
    .search-bar {
        width: 100%;
        margin-top: 15px;
        margin-left: 0;
        order: 2; /* Position after menu toggle, before main nav */
        display: flex;
        justify-content: center;
    }
    .search-bar input[type="search"] {
        flex-grow: 1;
        width: auto;
        max-width: none;
    }
    .search-bar button {
        margin-left: 10px;
        border-radius: 25px;
        left: 0;
    }
    .logo-area {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }
    .header-top-bar .container {
        flex-direction: column;
        align-items: flex-start;
    }
    .top-nav {
        width: 100%;
        margin-top: 10px;
    }
    .top-nav ul {
        flex-direction: column;
        width: 100%;
    }
    .top-nav ul li {
        margin-left: 0;
        border-bottom: 1px solid #e0e0e0;
    }
    .top-nav ul li:last-child {
        border-bottom: none;
    }
    .top-nav ul li a {
        padding: 10px 0;
        display: block;
    }
}

/* Utility classes for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 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;
  }
}
