/* shared.css - 全局样式表 */

/* 引入字体 */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* 基础重置与全局变量 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --text-color: #212529;
    --border-color: #dee2e6;
    --font-family-base: 'Roboto', 'Noto Sans SC', sans-serif;
    --header-height: 80px;
    --footer-height: auto;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

.align-center {
    align-items: center;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--dark-color);
}

ul {
    list-style: none;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

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

.btn-primary:hover {
    background-color: #0056b3; /* Darker blue */
}

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

.btn-secondary:hover {
    background-color: #545b62; /* Darker gray */
}

/* Header Styles */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-topbar {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 8px 0;
    font-size: 0.85rem;
}

.header-topbar .contact-info span {
    margin-right: 20px;
}

.header-topbar .social-links .social-icon {
    color: var(--light-color);
    margin-left: 15px;
    font-size: 1rem;
}

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

.logo img {
    max-height: 40px;
}

.nav-menu {
    display: flex;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--dark-color);
    font-weight: 500;
    padding: 5px 0;
    transition: color 0.3s ease;
}

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

.has-submenu .nav-link i {
    margin-left: 5px;
    font-size: 0.75rem;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    border-radius: 5px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 10;
}

.nav-item.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li a {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    white-space: nowrap;
}

.submenu li a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

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

.search-toggle, .mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--dark-color);
}

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
}

.mobile-menu-overlay.active {
    transform: translateX(0);
}

.mobile-nav-menu {
    text-align: center;
}

.mobile-nav-menu li {
    margin: 20px 0;
}

.mobile-nav-menu li a {
    color: #fff;
    font-size: 1.8rem;
    font-weight: 500;
    padding: 10px 20px;
    transition: color 0.3s ease;
}

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

/* Main Content Wrapper */
#main-content-wrapper {
    flex-grow: 1; /* Allows content to take up available space */
}

/* Footer Styles */
.main-footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 60px 0 30px;
    font-size: 0.9rem;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-widget h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-widget h3::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--accent-color);
    margin-top: 10px;
}

.footer-widget p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.7);
}

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

.contact-info-footer p i {
    margin-right: 10px;
    color: var(--primary-color);
}

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

.footer-widget ul li a {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.footer-widget ul li a:hover {
    color: var(--primary-color);
}

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

.newsletter-form input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px 0 0 5px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    outline: none;
}

.newsletter-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.newsletter-form .btn-secondary {
    border-radius: 0 5px 5px 0;
    padding: 10px 18px;
    background-color: var(--accent-color);
}

.newsletter-form .btn-secondary:hover {
    background-color: #1e7e34; /* Darker green */
}

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

.social-icon-footer {
    color: #fff;
    font-size: 1.3rem;
    transition: color 0.3s ease;
}

.social-icon-footer:hover {
    color: var(--primary-color);
}

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

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
}

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

/* Responsive Design */
@media (max-width: 992px) {
    .nav-menu {
        display: none; /* Hide desktop menu */
    }
    .mobile-menu-toggle {
        display: block; /* Show mobile menu toggle */
    }
    .main-navigation .container {
        justify-content: space-between;
    }
    .header-actions .btn {
        display: none; /* Hide login button on smaller screens, can be moved to mobile menu */
    }
    .header-actions .search-toggle {
        margin-right: 10px;
    }
}

@media (max-width: 768px) {
    .header-topbar {
        display: none; /* Hide top bar on very small screens */
    }
    .footer-widgets {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-widget h3::after {
        margin-left: auto;
        margin-right: auto;
    }
    .newsletter-form {
        max-width: 350px;
        margin-left: auto;
        margin-right: auto;
    }
    .social-media-footer {
        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;
  }
}
