/* Basic Resets & Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #343a40;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --white: #ffffff;
    --border-color: #dee2e6;
    --font-family-sans-serif: 'Roboto', 'Open Sans', sans-serif;
    --font-family-monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

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

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

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

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

a:hover {
    color: #0056b3; /* Darkened primary color */
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

p {
    margin-bottom: 1em;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 8px;
    z-index: 9999;
    transition: top 0.3s ease-in-out;
}

.skip-link:focus {
    top: 0;
}

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

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

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

.btn-secondary {
    background-color: var(--white);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

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

.header-top-bar {
    background-color: var(--dark-bg);
    color: var(--white);
    padding: 8px 0;
    text-align: center;
    font-size: 0.9em;
}

.announcement-bar .announcement-link {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: underline;
}

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

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

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

.navigation-menu {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.navigation-menu .menu-item {
    position: relative;
}

.navigation-menu .menu-item > a {
    display: block;
    padding: 10px 0;
    color: var(--text-color);
    font-weight: 600;
}

.navigation-menu .menu-item > a:hover,
.navigation-menu .menu-item > a:focus {
    color: var(--primary-color);
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    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 var(--primary-color);
}

.menu-item.has-submenu:hover .submenu,
.menu-item.has-submenu:focus-within .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

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

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

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
}

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

/* Main Content Area */
main {
    flex-grow: 1; /* Ensures footer sticks to bottom */
    padding: 40px 0;
}

/* Footer Styles */
.site-footer {
    background-color: var(--dark-bg);
    color: var(--white);
    padding: 60px 0 30px;
    font-size: 0.9em;
    position: relative;
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.footer-columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-col {
    flex: 1 1 200px; /* Allows columns to grow and shrink */
    min-width: 200px;
}

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

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

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

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

.footer-col ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

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

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

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

.social-links a {
    color: var(--white);
    font-size: 1.2em;
    width: 35px;
    height: 35px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

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

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--white);
    color: var(--text-color);
}

.newsletter-form button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #0056b3; /* Darkened primary color */
}

.contact-info {
    margin-top: 20px;
    font-style: normal;
}

.contact-info p {
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.7);
}

.contact-info a {
    color: rgba(255, 255, 255, 0.7);
}

.contact-info a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

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

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

.legal-links li a {
    color: rgba(255, 255, 255, 0.5);
}

.legal-links li a:hover {
    color: var(--primary-color);
}

.back-to-top {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.2em;
    position: absolute;
    bottom: 30px;
    right: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 900;
    opacity: 0; /* Hidden by default */
    visibility: hidden;
    transform: translateY(20px);
}

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

.back-to-top:hover {
    background-color: #0056b3; /* Darkened primary color */
    transform: translateY(-5px);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .navigation-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--white);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
    }

    .navigation-menu.active {
        display: flex;
    }

    .navigation-menu .menu-item {
        width: 100%;
        text-align: left;
    }

    .navigation-menu .menu-item > a {
        padding: 12px 20px;
        border-bottom: 1px solid var(--border-color);
    }

    .menu-toggle {
        display: block;
    }

    .main-header-wrapper {
        flex-wrap: wrap;
    }

    .main-navigation {
        order: 3; /* Push navigation below logo/actions on smaller screens */
        flex-basis: 100%;
        margin-top: 10px;
    }

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

    .submenu {
        position: static;
        box-shadow: none;
        border-top: none;
        padding-left: 20px;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none; /* Controlled by JS for mobile */
    }

    .menu-item.has-submenu.active .submenu {
        display: block;
    }

    .footer-columns {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-col {
        min-width: unset;
        width: 100%;
        margin-bottom: 30px;
    }

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

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form button {
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .legal-links {
        flex-direction: column;
        gap: 10px;
    }

    .back-to-top {
        right: 15px;
        bottom: 15px;
    }
}

@media (max-width: 768px) {
    .main-header-wrapper {
        padding: 10px 0;
    }
    .logo img {
        height: 35px;
    }
    .header-top-bar {
        font-size: 0.8em;
        padding: 5px 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;
  }
}
