/* Basic Reset & Typography */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333;
    --light-text-color: #f8f9fa;
    --background-color: #ffffff;
    --light-background: #f8f9fa;
    --dark-background: #343a40;
    --border-color: #dee2e6;
    --font-family-base: 'Noto Sans SC', 'Roboto', sans-serif;
    --font-family-heading: 'Noto Sans SC', 'Roboto', sans-serif;
    --header-height: 80px;
    --mobile-header-height: 60px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size */
}

body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    margin-bottom: 0.5em;
    color: var(--dark-background);
    line-height: 1.2;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

p {
    margin-bottom: 1em;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

.align-center {
    align-items: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

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

.btn-primary {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3; /* Darker blue */
    border-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #545b62; /* Darker grey */
    border-color: #545b62;
}

.btn-subscribe {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    border-color: var(--accent-color);
    padding: 10px 15px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.btn-subscribe:hover {
    background-color: #218838;
    border-color: #218838;
}


/* Header Styles */
.site-header {
    background-color: var(--background-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.header-top-bar {
    background-color: var(--dark-background);
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 0;
    font-size: 0.9em;
}

.header-top-bar .contact-info span,
.header-top-bar .utility-links a {
    margin-right: 20px;
    color: inherit;
}

.header-top-bar .contact-info span:last-child,
.header-top-bar .utility-links a:last-child {
    margin-right: 0;
}

.header-top-bar .language-switcher select {
    background-color: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}

.header-top-bar .language-switcher select option {
    color: var(--text-color);
    background-color: var(--background-color);
}


.header-main {
    padding: 15px 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.branding .logo img {
    max-height: 40px;
    width: auto;
}

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

.main-navigation .nav-item {
    position: relative;
}

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

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

.main-navigation .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.main-navigation .nav-link:hover::after {
    width: 100%;
}

.nav-item.has-dropdown > .nav-link i {
    font-size: 0.7em;
    margin-left: 5px;
    vertical-align: middle;
}

.dropdown-menu, .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--background-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    min-width: 200px;
    border-radius: 5px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 100;
}

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

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

.dropdown-menu li a:hover {
    background-color: var(--light-background);
    color: var(--primary-color);
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .submenu {
    left: 100%;
    top: 0;
}

.dropdown-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
}

.search-form-container {
    position: absolute;
    right: 0;
    top: 100%; /* Position below the toggle button */
    background-color: var(--background-color);
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: none; /* Hidden by default */
    z-index: 99;
}

.search-form-container.active {
    display: block;
}

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

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

.search-form button {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

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

.user-auth .btn {
    margin-left: 10px;
}

.hamburger-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 1.5em;
    color: var(--text-color);
    position: relative;
    width: 30px;
    height: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-menu-toggle .icon-bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

/* Mobile Navigation */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    display: none; /* Hidden by default */
    justify-content: flex-end; /* Align content to the right */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    display: flex;
    opacity: 1;
}

.mobile-nav-content {
    background-color: var(--background-color);
    width: 300px; /* Adjust as needed */
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    padding: 20px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    position: relative;
}

.mobile-nav-overlay.active .mobile-nav-content {
    transform: translateX(0);
}

.close-mobile-nav {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-color);
}

.mobile-navigation ul {
    padding-top: 50px; /* Space for close button */
}

.mobile-navigation li {
    border-bottom: 1px solid var(--border-color);
}

.mobile-navigation li:last-child {
    border-bottom: none;
}

.mobile-navigation a {
    display: block;
    padding: 15px 0;
    color: var(--text-color);
    font-weight: 500;
}

.mobile-navigation a:hover {
    color: var(--primary-color);
}

.mobile-has-submenu a {
    position: relative;
    padding-right: 30px;
}

.mobile-has-submenu a::after {
    content: '\f054'; /* Font Awesome chevron-right */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.mobile-has-submenu.open > a::after {
    transform: translateY(-50%) rotate(90deg);
}

.mobile-submenu {
    display: none;
    padding-left: 20px;
    background-color: var(--light-background);
}

.mobile-submenu li {
    border-bottom: none;
}

/* Footer Styles */
.site-footer {
    background-color: var(--dark-background);
    color: var(--light-text-color);
    padding: 60px 0 30px;
    font-size: 0.95em;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

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

.footer-col h3 {
    color: var(--light-text-color);
    margin-bottom: 20px;
    font-size: 1.2em;
}

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

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

.footer-col p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.footer-logo img {
    margin-bottom: 20px;
}

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

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

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

.footer-col address p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.footer-col address p i {
    margin-right: 10px;
    margin-top: 3px;
    font-size: 1.1em;
    color: var(--primary-color);
}

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

.newsletter-signup h4 {
    color: var(--light-text-color);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.newsletter-signup form {
    display: flex;
}

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

.footer-bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    margin-top: 30px;
}

.footer-bottom-bar .copyright {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom-bar .legal-links {
    display: flex;
    gap: 20px;
}

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 900;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .header-top-bar {
        display: none; /* Hide top bar on smaller screens */
    }

    .header-main {
        height: var(--mobile-header-height);
        padding: 10px 0;
    }

    .main-navigation {
        display: none; /* Hide main nav on smaller screens */
    }

    .header-actions {
        gap: 10px;
    }

    .user-auth {
        display: none; /* Hide login/register buttons on mobile, move to mobile nav */
    }

    .hamburger-menu-toggle {
        display: flex; /* Show hamburger menu */
    }

    .search-box {
        order: -1; /* Move search to the left for better access */
    }

    .search-form-container {
        right: auto;
        left: 0;
        width: 100%;
        max-width: none;
        top: calc(var(--mobile-header-height) + 5px);
    }

    .site-footer {
        padding: 40px 0 20px;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col h3 {
        margin-top: 30px;
    }

    .footer-col ul {
        padding-left: 0;
    }

    .footer-logo img {
        margin-left: auto;
        margin-right: auto;
    }

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

    .newsletter-signup form {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-bottom-bar .flex-between {
        flex-direction: column;
        gap: 15px;
    }

    .footer-bottom-bar .legal-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.75em; }
    h3 { font-size: 1.5em; }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
