/* Basic Reset & Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-color: #dee2e6;
    --font-family-sans: 'Roboto', 'Arial', sans-serif;
    --font-family-serif: 'Georgia', serif;
}

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

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

.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;
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
    transform: translateY(-1px);
}

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

.btn-subscribe:hover {
    background-color: #218838;
    border-color: #218838;
    transform: translateY(-1px);
}

/* Header Specific Styles */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1000;
}

.header-top-bar {
    background-color: var(--dark-bg);
    color: #e9ecef;
    padding: 8px 0;
    font-size: 0.85em;
}

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

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

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

.top-bar-nav a {
    color: #e9ecef;
    opacity: 0.8;
}

.top-bar-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
    opacity: 1;
}

.language-selector {
    position: relative;
}

.language-selector .dropdown-menu {
    min-width: 120px;
    left: auto;
    right: 0;
    transform: translateX(0);
}

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

.navbar-brand {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px; /* Adjust as needed */
    width: auto;
    margin-right: 10px;
}

.site-name {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-color);
    /* Hide visually for accessible logo text */
}

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

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

.main-navigation .nav-list {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-item a {
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease;
}

.nav-item a i {
    margin-left: 5px;
    font-size: 0.8em;
}

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

.has-dropdown:hover > .dropdown-menu,
.has-dropdown a[aria-expanded="true"] + .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 100;
    border-radius: 5px;
    padding: 10px 0;
    margin-top: 10px;
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    padding: 10px 15px;
    font-size: 0.95em;
    color: var(--text-color);
    white-space: nowrap;
    display: block;
    text-align: left;
}

.dropdown-menu a:hover {
    color: var(--primary-color);
    background-color: var(--light-bg);
    text-decoration: none;
}

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

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

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

.search-box {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    overflow: hidden;
    background-color: var(--light-bg);
}

.search-box input {
    border: none;
    padding: 8px 15px;
    outline: none;
    width: 180px;
    background-color: transparent;
}

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

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

/* Footer Specific Styles */
.main-footer {
    background-color: var(--dark-bg);
    color: #e9ecef;
    padding: 50px 0;
    margin-top: auto; /* Pushes footer to the bottom */
    font-size: 0.9em;
}

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

.footer-widget {
    flex: 1;
    min-width: 220px;
    max-width: 280px; /* Adjust max-width for better layout */
}

.footer-widget h3 {
    color: #fff;
    margin-bottom: 25px;
    font-size: 1.3em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    font-weight: 600;
}

.footer-widget p {
    font-size: 0.95em;
    margin-bottom: 15px;
    line-height: 1.7;
}

.footer-widget ul {
    padding: 0;
    list-style: none;
}

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

.footer-widget a {
    color: #e9ecef;
    font-size: 0.92em;
    transition: color 0.3s ease;
    display: inline-block;
}

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

.contact-info p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.contact-info i {
    color: var(--primary-color);
    font-size: 1.1em;
    margin-top: 3px;
}

.newsletter-form {
    display: flex;
    margin-top: 20px;
    width: 100%;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 5px 0 0 5px;
    outline: none;
    background-color: rgba(255,255,255,0.9);
    color: var(--text-color);
}

.newsletter-form .btn-subscribe {
    border-radius: 0 5px 5px 0;
    padding: 12px 20px;
    font-weight: 600;
}

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

.social-media a {
    color: #fff;
    font-size: 1.6em;
    transition: color 0.3s ease, transform 0.2s ease;
}

.social-media a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 25px;
    text-align: center;
    font-size: 0.8em;
    line-height: 1.8;
}

.footer-bottom .copyright {
    margin-bottom: 15px;
    color: #adb5bd;
}

.footer-legal-nav ul {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-legal-nav a {
    color: #adb5bd;
}

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

/* Responsive Adjustments */
@media (max-width: 992px) {
    .header-top-bar .welcome-message {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
        padding-right: 0;
    }
    .top-bar-nav ul {
        justify-content: center;
        width: 100%;
    }
    .header-main-nav .container {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .navbar-brand {
        margin-bottom: 15px;
    }
    .main-navigation {
        width: 100%;
        order: 3; /* Push navigation below brand and actions */
        margin-top: 15px;
    }
    .main-navigation .nav-list {
        justify-content: space-around;
        gap: 15px;
        flex-wrap: wrap;
    }
    .header-actions {
        order: 2;
        margin-left: auto; /* Push actions to the right */
    }
    .search-box input {
        width: 120px;
    }
    .footer-widget {
        flex-basis: 45%; /* Two columns on medium screens */
        max-width: 48%;
    }
}

@media (max-width: 768px) {
    .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    .top-bar-nav ul {
        margin-top: 10px;
        justify-content: center;
        gap: 15px;
    }

    .menu-toggle {
        display: block; /* Show hamburger menu */
        margin-left: auto;
    }
    .main-navigation .nav-list {
        display: none; /* Hide by default on mobile */
        flex-direction: column;
        width: 100%;
        background-color: #f4f4f4;
        position: absolute;
        top: 100%; /* Below header */
        left: 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        padding: 10px 0;
        border-top: 1px solid var(--border-color);
    }
    .main-navigation .nav-list.active {
        display: flex; /* Show when active */
    }
    .nav-item {
        width: 100%;
        text-align: left;
    }
    .nav-item a {
        padding: 12px 20px;
        border-bottom: 1px solid #eee;
    }
    .dropdown-menu {
        position: static;
        box-shadow: none;
        width: 100%;
        padding-left: 20px;
        margin-top: 0;
        transform: none;
        border-top: 1px solid #eee;
        background-color: #ececec;
    }
    .dropdown-menu li a {
        padding: 10px 30px;
        font-size: 0.9em;
    }
    .header-actions {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
        gap: 10px;
    }
    .search-box {
        width: 100%;
        max-width: 300px;
    }
    .search-box input {
        width: 100%;
    }

    .footer-widgets {
        flex-direction: column;
        align-items: center;
    }
    .footer-widget {
        max-width: 100%;
        width: 100%;
        text-align: center;
    }
    .contact-info p {
        justify-content: center;
    }
    .newsletter-form {
        justify-content: center;
    }
    .social-media {
        justify-content: center;
    }
    .footer-legal-nav ul {
        flex-direction: column;
        gap: 10px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
