/* global.css */
:root {
    --primary-color: #0056b3;
    --secondary-color: #007bff;
    --text-color: #333;
    --background-color: #f8f9fa;
    --header-height: 70px;
    --footer-height: auto;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.main-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    height: 40px;
}

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

.main-nav .nav-item {
    position: relative;
    margin-left: 30px;
}

.main-nav .nav-link {
    display: block;
    padding: 20px 0;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav .nav-link:hover,
.main-nav .nav-link:focus {
    color: var(--primary-color);
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 1;
    border-top: 3px solid var(--primary-color);
    padding: 10px 0;
    left: -15px;
}

.nav-item:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    color: var(--text-color);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f1f1f1;
    color: var(--primary-color);
}

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

.search-btn, .login-btn, .mobile-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 15px;
    color: var(--text-color);
    font-size: 1.1em;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.login-btn {
    background-color: var(--primary-color);
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    font-size: 0.9em;
}

.login-btn:hover {
    background-color: #004085;
}

.mobile-menu-toggle {
    display: none; /* Hidden by default, shown on smaller screens */
}

.mobile-menu {
    display: none;
    background-color: #fff;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 999;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-list li a {
    display: block;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-list li:last-child a {
    border-bottom: none;
}

.mobile-nav-list li a:hover {
    background-color: #f8f8f8;
}

/* Footer Styles */
.main-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0;
    font-size: 0.9em;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

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

.footer-logo img {
    height: 32px;
    margin-bottom: 15px;
}

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

.footer-section p {
    margin-bottom: 20px;
}

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

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

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #fff;
}

.social-links a {
    color: #ecf0f1;
    font-size: 1.5em;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: #fff;
}

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

.newsletter-form input[type="email"] {
    border: none;
    padding: 10px 15px;
    border-radius: 4px 0 0 4px;
    outline: none;
    flex-grow: 1;
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #004085;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.legal-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: #fff;
}

.legal-links .separator {
    color: #bdc3c7;
}

.copyright {
    margin-top: 15px;
    color: #bdc3c7;
}

/* Icon placeholders (replace with actual font icons or SVGs) */
.icon-search::before { content: '🔍'; }
.icon-menu::before { content: '☰'; }
.icon-weibo::before { content: ' Weibo'; }
.icon-weixin::before { content: ' WeChat'; }
.icon-linkedin::before { content: ' LinkedIn'; }
.icon-github::before { content: ' GitHub'; }

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-nav {
        display: none;
    }
    .mobile-menu-toggle {
        display: block;
    }
    .header-container {
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-section {
        min-width: unset;
        width: 100%;
        margin-bottom: 30px;
    }
    .footer-section:last-child {
        margin-bottom: 0;
    }
    .newsletter-form {
        justify-content: center;
    }
    .social-links {
        margin-top: 20px;
    }
}

#scrollToTopBtn {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position */
    bottom: 30px; /* Place the button at the bottom of the page */
    right: 30px; /* Place the button at the right of the page */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: var(--primary-color); /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 10px; /* Rounded corners */
    font-size: 18px; /* Increase font size */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#scrollToTopBtn:hover {
    background-color: #004085; /* Darker background on hover */
    transform: translateY(-2px);
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
