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

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

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

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -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;
}

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

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

p {
    margin-bottom: 1em;
}

ul, ol {
    list-style: none;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    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: #fff;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: darken(var(--primary-color), 10%);
    border-color: darken(var(--primary-color), 10%);
}

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

.btn-secondary:hover {
    background-color: darken(var(--secondary-color), 10%);
    border-color: darken(var(--secondary-color), 10%);
}

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

.btn-subscribe:hover {
    background-color: darken(var(--accent-color), 10%);
    border-color: darken(var(--accent-color), 10%);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-family-sans);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Header Specifics */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.brand-logo a {
    display: flex;
    align-items: center;
    color: var(--dark-bg);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.brand-logo .logo-img {
    height: 40px;
    margin-right: 10px;
}

.main-navigation .nav-menu {
    display: flex;
    gap: 20px;
}

.main-navigation .nav-menu li a {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-navigation .nav-menu li a:hover {
    color: var(--primary-color);
}

.main-navigation .menu-item-has-children {
    position: relative;
}

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

.main-navigation .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.main-navigation .sub-menu li a {
    padding: 8px 20px;
    display: block;
    white-space: nowrap;
}

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

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

.search-field {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9rem;
    width: 180px;
    transition: width 0.3s ease;
}

.search-field:focus {
    width: 220px;
}

.search-submit {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    margin-left: -30px;
    padding: 5px;
}

.search-submit:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-bg);
}

.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;
}

.announcement-bar {
    background-color: #ffc107; /* Warning yellow */
    color: #333;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.announcement-bar a {
    color: var(--primary-color);
    font-weight: bold;
}

/* Footer Specifics */
.main-footer {
    background-color: var(--dark-bg);
    color: #f8f9fa;
    padding: 40px 0 20px;
    font-size: 0.9rem;
}

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

.footer-section {
    flex: 1;
    min-width: 220px;
}

.footer-section .section-title {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.footer-section p {
    color: #ccc;
    margin-bottom: 10px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

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

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

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

.contact-info i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.newsletter-form {
    margin-top: 20px;
}

.newsletter-form input[type="email"] {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    margin-right: 5px;
    width: calc(100% - 100px); /* Adjust width for button */
    display: inline-block;
    vertical-align: middle;
}

.newsletter-form input[type="email"]::placeholder {
    color: #ccc;
}

.newsletter-form .btn-subscribe {
    width: 90px;
    padding: 10px;
    font-size: 0.9rem;
    vertical-align: middle;
}

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

.social-links li a {
    font-size: 1.5rem;
    color: #fff;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #ccc;
}

.footer-bottom p {
    margin-bottom: 8px;
}

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

.footer-bottom a:hover {
    color: #fff;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .main-navigation .nav-menu {
        display: none; /* Hide nav on smaller screens by default */
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 10px 0;
        z-index: 999;
    }

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

    .main-navigation .menu-toggle {
        display: block;
    }

    .header-container {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

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

    .search-form {
        display: none; /* Hide search form on smaller screens */
    }

    .user-profile {
        margin-left: 10px;
    }

    .main-navigation .menu-item-has-children .sub-menu {
        position: static;
        box-shadow: none;
        background-color: #f0f0f0;
        padding-left: 20px;
        border-radius: 0;
    }

    .main-navigation .menu-item-has-children:hover > .sub-menu {
        display: none; /* JavaScript will handle this */
    }

    .main-navigation .menu-item-has-children.active > .sub-menu {
        display: block;
    }

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

    .footer-section {
        width: 100%;
        max-width: 400px;
    }

    .social-links {
        justify-content: center;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
