/* Basic Reset & Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Body & Typography */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
    margin-bottom: 0.5em;
    color: #222;
    line-height: 1.2;
}

p {
    margin-bottom: 1em;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

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

ul {
    list-style: none;
}

/* Accessibility */
.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;
}

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col-md-4 {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
    padding: 0 15px;
}

.col-md-2 {
    flex: 0 0 16.66667%;
    max-width: 16.66667%;
    padding: 0 15px;
}

/* Utility Margins */
.mt-3 {
    margin-top: 1rem !important;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: #007bff;
    border: 1px solid #007bff;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.btn:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
    text-decoration: none;
}

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

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

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

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

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Header Specific Styles */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.top-bar {
    background-color: #f2f2f2;
    padding: 10px 0;
    font-size: 0.9em;
    border-bottom: 1px solid #eee;
}

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

.top-bar-left span, .top-bar-right a {
    margin-right: 15px;
    color: #666;
    white-space: nowrap;
}

.top-bar-right a:last-child {
    margin-right: 0;
}

.top-bar-left i, .top-bar-right i {
    margin-right: 5px;
    color: #007bff;
}

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

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

.logo img {
    display: block;
    height: auto;
    max-height: 50px;
}

.main-navigation ul {
    display: flex;
    margin: 0;
    padding: 0;
}

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

.main-navigation a {
    display: block;
    padding: 10px 0;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
}

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

.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    min-width: 220px;
    z-index: 10;
    padding: 10px 0;
    border-top: 3px solid #007bff;
    list-style: none;
}

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

.main-navigation .sub-menu a {
    padding: 8px 20px;
    white-space: nowrap;
    font-weight: normal;
    text-transform: none;
    color: #555;
}

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

.main-navigation li:hover > .sub-menu {
    display: block;
}

.main-navigation .sub-menu .sub-menu {
    left: 100%;
    top: 0;
    border-top: none;
    border-left: 3px solid #007bff;
}

.menu-toggle, .search-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #333;
    padding: 5px 10px;
}

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

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

.header-actions .btn {
    margin-left: 20px;
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1001;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-form {
    display: flex;
    width: 90%;
    max-width: 700px;
    position: relative;
}

.search-form input {
    flex-grow: 1;
    padding-right: 60px;
    border-radius: 5px;
    border: none;
    height: 50px;
    font-size: 1.2em;
}

.search-form button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8em;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
}

.search-form .close-search {
    position: absolute;
    top: -50px;
    right: 0;
    font-size: 2.5em;
    color: #fff;
    line-height: 1;
}

/* Footer Specific Styles */
.site-footer {
    background-color: #222;
    color: #ccc;
    padding: 60px 0 20px;
    font-size: 0.9em;
    margin-top: auto; /* Pushes footer to the bottom */
}

.site-footer a {
    color: #eee;
}

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

.footer-widgets {
    margin-bottom: 40px;
}

.footer-widget {
    margin-bottom: 30px;
}

.footer-widget .widget-title {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-widget .widget-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background-color: #007bff;
    position: absolute;
    bottom: 0;
    left: 0;
}

.footer-widget ul {
    margin: 0;
    padding: 0;
}

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

.footer-widget ul li a {
    display: block;
    padding: 2px 0;
    transition: color 0.3s ease;
}

.footer-widget ul li a:hover {
    color: #007bff;
    padding-left: 5px; /* Subtle hover effect */
}

.contact-info span {
    display: block;
    margin-bottom: 8px;
}

.contact-info i {
    margin-right: 10px;
    color: #007bff;
}

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

.newsletter-form input {
    flex-grow: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #333;
    border-color: #444;
    color: #fff;
}

.newsletter-form input::placeholder {
    color: #bbb;
}

.newsletter-form button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    flex-shrink: 0;
}

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

.social-links .social-icon {
    width: 40px;
    height: 40px;
    background-color: #444;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin-right: 10px;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.social-links .social-icon:hover {
    background-color: #007bff;
    transform: translateY(-3px);
}

.bottom-bar {
    border-top: 1px solid #333;
    padding-top: 20px;
    margin-top: 40px;
}

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

.copyright {
    margin-bottom: 10px;
    flex-basis: auto;
}

.footer-menu ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.footer-menu ul li {
    margin-left: 20px;
}

.footer-menu ul li:first-child {
    margin-left: 0;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-header .container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .logo {
        order: 1;
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    .main-navigation {
        order: 3;
        flex-basis: 100%;
        margin-top: 0;
        border-top: 1px solid #eee;
        padding-top: 15px;
    }
    .main-navigation .nav-menu {
        flex-direction: column;
        display: none; /* Hidden by default for mobile */
        width: 100%;
        text-align: center;
    }
    .main-navigation .nav-menu.active {
        display: flex;
    }
    .main-navigation li {
        margin: 0;
        border-bottom: 1px solid #eee;
        width: 100%;
    }
    .main-navigation li:last-child {
        border-bottom: none;
    }
    .main-navigation a {
        padding: 12px 15px;
    }
    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        border-top: none;
        border-left: none;
        padding-left: 20px;
        width: 100%;
        text-align: left;
    }
    .main-navigation .sub-menu a {
        padding: 8px 30px;
    }
    .main-navigation li:hover > .sub-menu {
        display: none; /* Handled by JS for touch */
    }
    .menu-toggle {
        display: block;
        order: 2;
        margin-right: auto;
    }
    .search-toggle {
        order: 2;
        display: block;
        margin-left: auto;
    }
    .header-actions {
        order: 4;
        width: 100%;
        justify-content: center;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid #eee;
    }
    .header-actions .btn {
        margin-left: 0;
        margin-top: 10px;
    }
    .col-md-4, .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
        text-align: center;
    }
    .footer-widget .widget-title::after {
        margin: 10px auto 0;
        left: 0;
        right: 0;
    }
    .footer-widget ul {
        display: inline-block;
        text-align: left;
    }
    .contact-info span {
        display: inline-block;
        margin-right: 15px;
        margin-bottom: 5px;
    }
    .newsletter-form {
        flex-direction: column;
        align-items: center;
    }
    .newsletter-form input {
        border-radius: 0.25rem;
        margin-bottom: 10px;
        max-width: 300px;
    }
    .newsletter-form button {
        border-radius: 0.25rem;
        width: auto;
    }
    .social-links {
        justify-content: center;
    }
    .bottom-bar .container {
        flex-direction: column;
        text-align: center;
    }
    .footer-menu ul {
        flex-direction: column;
        margin-top: 10px;
    }
    .footer-menu ul li {
        margin-left: 0;
        margin-bottom: 8px;
    }
}

@media (max-width: 768px) {
    .top-bar .container {
        flex-direction: column;
        text-align: center;
    }
    .top-bar-left, .top-bar-right {
        margin-bottom: 10px;
    }
    .top-bar-left span, .top-bar-right a {
        margin-right: 8px;
        margin-left: 8px;
    }
    .search-form input {
        font-size: 1em;
        height: 45px;
    }
    .search-form button {
        font-size: 1.4em;
    }
    .search-form .close-search {
        font-size: 2em;
        top: -40px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
