/* Basic Resets & Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #0056b3;
    --secondary-color: #6c757d;
    --text-color: #333;
    --background-color: #f8f9fa;
    --light-gray: #e9ecef;
    --border-color: #dee2e6;
    --white: #fff;
    --dark: #212529;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
    color: #003d82;
    text-decoration: underline;
}

ul {
    list-style: none;
}

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

/* Buttons */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: #004494;
    text-decoration: none;
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background-color: #004494;
}

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

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

.btn-signup {
    background-color: #28a745;
}

.btn-signup:hover {
    background-color: #218838;
}

/* Header Styles */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

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

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

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

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 10px 0;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.05rem;
}

.nav-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.has-dropdown:hover > .nav-link {
    color: var(--primary-color);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 10;
    border-radius: 5px;
    overflow: hidden;
}

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

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

.has-dropdown:hover .dropdown-menu {
    display: block;
}

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

.search-box {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
}

.search-input {
    border: none;
    padding: 8px 15px;
    outline: none;
    font-size: 0.9rem;
    width: 150px;
}

.search-button {
    background-color: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
}

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

.header-banner {
    background-color: #e0f2f7;
    padding: 60px 0;
    text-align: center;
    margin-top: 20px;
    border-radius: 8px;
}

.header-banner h1 {
    font-size: 2.8rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.header-banner p {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

/* Footer Styles */
.main-footer {
    background-color: var(--dark);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 50px;
    font-size: 0.9rem;
}

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

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-col p {
    margin-bottom: 10px;
    line-height: 1.8;
    color: #ccc;
}

.footer-col ul {
    padding: 0;
}

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

.footer-col ul li a {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--white);
    text-decoration: underline;
}

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

.social-media a {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-color: #444;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}

.social-media a:hover {
    background-color: var(--primary-color);
}

.social-media img {
    width: 20px;
    height: 20px;
    filter: invert(1); /* Makes icons white */
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #444;
    padding-top: 20px;
    color: #ccc;
}

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

.footer-bottom a {
    color: #ccc;
}

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

/* Responsive Design */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Hide main nav on smaller screens */
        width: 100%;
        order: 3; /* Move below logo and actions */
        margin-top: 20px;
        background-color: var(--white);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-radius: 5px;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav .nav-list {
        flex-direction: column;
        padding: 10px 0;
    }

    .nav-item {
        border-bottom: 1px solid var(--light-gray);
    }
    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        padding: 12px 20px;
    }

    .dropdown-menu {
        position: static; /* Make dropdown stack */
        box-shadow: none;
        background-color: var(--light-gray);
        border-radius: 0;
        padding-left: 20px;
    }

    .dropdown-menu a {
        padding: 10px 20px;
    }

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

    .header-actions {
        order: 2;
    }

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

    .logo {
        flex-grow: 1;
    }

    .search-box {
        display: none; /* Hide search on mobile for simplicity */
    }
}

@media (max-width: 768px) {
    .header-banner h1 {
        font-size: 2rem;
    }
    .header-banner p {
        font-size: 1rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col ul {
        display: inline-block; /* For better centering of list items */
        text-align: left;
    }
    .social-media {
        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;
  }
}
