/* Basic Reset & Body Styling */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* General Link & Button Styles */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

/* Header Styling */
.main-header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    background-color: #2c3e50;
    color: #e0e0e0;
    padding: 8px 0;
    font-size: 0.85em;
}

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

.header-top-bar .top-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.header-top-bar .top-menu li {
    margin-right: 25px;
}

.header-top-bar .top-menu a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.header-top-bar .top-menu a:hover {
    color: #007bff;
}

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

.user-actions .btn {
    background-color: #007bff;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}

.user-actions .btn:hover {
    background-color: #0056b3;
}

.language-selector select {
    margin-left: 15px;
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #f8f8f8;
    font-size: 0.9em;
}

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

.branding {
    display: flex;
    align-items: center;
}

.branding .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
    font-size: 1.6em;
    font-weight: bold;
}

.branding img {
    margin-right: 12px;
    max-height: 45px;
}

.main-navigation .nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-navigation .nav-menu li {
    position: relative;
    margin-left: 35px;
}

.main-navigation .nav-menu a {
    color: #333;
    text-decoration: none;
    padding: 12px 0;
    display: block;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.main-navigation .nav-menu a:hover,
.main-navigation .nav-menu a.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

.main-navigation .has-submenu > a::after {
    content: '▼';
    font-size: 0.6em;
    margin-left: 6px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.main-navigation .has-submenu:hover > a::after {
    transform: rotate(180deg);
}

.main-navigation .submenu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
    z-index: 10;
    border-radius: 5px;
}

.main-navigation .has-submenu:hover .submenu {
    display: block;
}

.main-navigation .submenu li {
    margin: 0;
}

.main-navigation .submenu a {
    padding: 10px 20px;
    white-space: nowrap;
    color: #555;
    border-bottom: none; /* Override parent border */
}

.main-navigation .submenu a:hover {
    background-color: #f8f8f8;
    color: #007bff;
}

.header-search {
    margin-left: auto;
}

.header-search form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
    background-color: #f0f2f5;
}

.header-search input[type="search"] {
    border: none;
    padding: 10px 18px;
    outline: none;
    flex-grow: 1;
    background-color: transparent;
    font-size: 0.95em;
}

.header-search button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Footer Styling */
.main-footer {
    background-color: #2c3e50;
    color: #e0e0e0;
    padding: 50px 0 25px;
    font-size: 0.9em;
}

.footer-widgets {
    padding-bottom: 40px;
    border-bottom: 1px solid #3a4c5e;
    margin-bottom: 25px;
}

.footer-widgets .widget-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.footer-widget h3 {
    color: #ffffff;
    font-size: 1.3em;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    display: inline-block; /* To make border-bottom only as wide as text */
}

.footer-widget p {
    margin-bottom: 12px;
    line-height: 1.7;
}

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

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

.footer-widget ul a {
    color: #b0c4de;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-widget ul a:hover {
    color: #007bff;
    text-decoration: underline;
}

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

.footer-widget address a {
    color: #b0c4de;
    text-decoration: none;
}

.footer-widget address a:hover {
    text-decoration: underline;
    color: #007bff;
}

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

.social-icons li {
    display: inline-block;
    margin: 0;
}

.social-icons a {
    background-color: #4a657c;
    color: #fff;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    font-size: 1.1em;
    text-indent: -9999px; /* Hide text, rely on icon or aria-label */
    position: relative;
}

.social-icons a::after {
    content: attr(aria-label);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    color: #fff;
    text-indent: 0; /* Show content for pseudo-element */
}

.social-icons a:hover {
    background-color: #007bff;
}

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

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    font-size: 1em;
    background-color: #fefefe;
}

.newsletter-form .btn-subscribe {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form .btn-subscribe:hover {
    background-color: #0056b3;
}

.footer-bottom-bar {
    text-align: center;
    padding-top: 25px;
}

.footer-bottom-bar .copyright,
.footer-bottom-bar .powered-by {
    margin: 8px 0;
    color: #a0b0c0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .header-main-section {
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }
    .branding {
        margin-bottom: 20px;
    }
    .main-navigation {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    .main-navigation .nav-menu {
        justify-content: center;
        flex-wrap: wrap;
    }
    .main-navigation .nav-menu li {
        margin: 0 15px 10px;
    }
    .header-search {
        margin: 0 auto;
        width: 100%;
        max-width: 500px;
    }
    .footer-widgets .widget-area {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .header-top-bar .top-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .header-top-bar .top-menu {
        margin-bottom: 10px;
        flex-wrap: wrap;
    }
    .header-top-bar .top-menu li {
        margin-right: 15px;
        margin-bottom: 5px;
    }
    .user-actions {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    .user-actions .btn {
        margin: 0 8px;
    }
    .language-selector {
        margin-left: 0;
        margin-top: 10px;
    }
    .main-navigation .menu-toggle {
        display: block; /* Show hamburger menu */
        background: none;
        border: none;
        font-size: 1.8em;
        color: #333;
        cursor: pointer;
        padding: 10px;
        width: 100%;
        text-align: right;
        order: -1; /* Place toggle before branding on smaller screens */
    }
    .main-navigation .nav-menu {
        display: none; /* Hide by default on small screens */
        flex-direction: column;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 4px 8px rgba(0,0,0,0.05);
        border-top: 1px solid #eee;
    }
    .main-navigation .nav-menu.active {
        display: flex; /* Show when active */
    }
    .main-navigation .nav-menu li {
        margin: 0;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-navigation .nav-menu li:last-child {
        border-bottom: none;
    }
    .main-navigation .nav-menu a {
        padding: 15px 20px;
    }
    .main-navigation .submenu {
        position: static;
        box-shadow: none;
        background-color: #f8f8f8;
        padding-left: 30px;
        border-radius: 0;
    }
    .main-navigation .has-submenu > a::after {
        float: right;
        margin-right: 20px;
        transform: rotate(0deg); /* Reset rotation */
    }
    .footer-widgets .widget-area {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-widget h3 {
        margin: 0 auto 15px auto;
    }
    .social-icons {
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
    }
    .newsletter-form {
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.menu-toggle { display: none; } /* Hide on large screens by default */
.icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 1px;
    background-color: #333;
    margin: 4px 0;
    transition: all 0.2s ease-in-out;
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
