/* shared.css */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

ul {
    list-style: none;
}

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

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

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

.logo img {
    height: 40px;
    vertical-align: middle;
}

.main-nav .nav-list {
    display: flex;
    gap: 25px;
}

.main-nav .nav-item {
    position: relative;
}

.main-nav .nav-link {
    color: #333;
    font-weight: 500;
    padding: 10px 0;
    display: block;
    position: relative;
}

.main-nav .nav-link:hover {
    color: #007bff;
    text-decoration: none;
}

.main-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 5px;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.main-nav .nav-link:hover::after,
.main-nav .nav-link.active::after {
    width: 100%;
}

/* Dropdown Menu */
.main-nav .has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    min-width: 160px;
    z-index: 1;
    border-radius: 4px;
    padding: 10px 0;
    top: 100%; /* Position below the parent link */
    left: 0;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu .dropdown-link {
    color: #333;
    padding: 10px 20px;
    display: block;
    white-space: nowrap;
}

.dropdown-menu .dropdown-link:hover {
    background-color: #f2f2f2;
    color: #007bff;
    text-decoration: none;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

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

.main-footer h3 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.2em;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.main-footer p {
    margin-bottom: 10px;
}

.main-footer a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-footer a:hover {
    color: #3498db;
    text-decoration: underline;
}

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

.footer-col ul {
    padding: 0;
}

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

.footer-col .social-links a {
    display: inline-block;
    margin-right: 15px;
    font-size: 20px;
}

.footer-col .social-links img {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    filter: invert(100%); /* Make icons white */
}

.footer-col .contact-info i {
    margin-right: 8px;
    color: #3498db;
}

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

.footer-col .newsletter input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #555;
    border-radius: 4px 0 0 4px;
    background-color: #3e5163;
    color: #ecf0f1;
    outline: none;
}

.footer-col .newsletter input[type="email"]::placeholder {
    color: #bdc3c7;
}

.footer-col .newsletter button {
    padding: 10px 20px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.footer-col .newsletter button:hover {
    background-color: #2980b9;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #3e5163;
    padding-top: 20px;
    margin-top: 20px;
}

/* Responsive Adjustments (basic) */
@media (max-width: 768px) {
    .main-nav .nav-list {
        display: none; /* Hide nav list by default on smaller screens */
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 70px; /* Adjust based on header height */
        left: 0;
        background-color: #fff;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        padding: 10px 0;
    }

    .main-nav .nav-list.active {
        display: flex; /* Show when active */
    }

    .main-nav .nav-item {
        width: 100%;
        text-align: center;
    }

    .main-nav .nav-link {
        padding: 15px 0;
        border-bottom: 1px solid #eee;
    }

    .main-nav .nav-link::after {
        display: none;
    }

    .main-nav .has-dropdown:hover .dropdown-menu {
        display: block;
        position: static; /* Adjust for mobile dropdown */
        box-shadow: none;
        padding-left: 20px;
        background-color: #f9f9f9;
        border-top: 1px solid #eee;
    }

    .menu-toggle {
        display: block; /* Show menu toggle button */
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col .newsletter form {
        justify-content: center;
    }
}

/* Utility classes */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
