/* Basic Reset & Body Styles */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header Styles */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

.logo img {
    height: 40px;
    width: auto;
}

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

.main-nav ul li {
    position: relative;
    margin-left: 25px;
}

.main-nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 10px 0;
    display: block;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.main-nav ul li a:hover {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

.main-nav .dropdown {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    min-width: 180px;
    z-index: 1000;
    list-style: none;
    padding: 10px 0;
    margin-top: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.main-nav ul li:hover > .dropdown {
    display: block;
}

.main-nav .dropdown li {
    margin: 0;
    border-bottom: none;
}

.main-nav .dropdown li a {
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    font-weight: normal;
    border-bottom: none;
}

.main-nav .dropdown li a:hover {
    background-color: #f1f1f1;
    color: #007bff;
    border-bottom: none;
}

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

.search-box {
    display: flex;
    margin-right: 20px;
}

.search-box input {
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 20px 0 0 20px;
    outline: none;
    font-size: 0.9em;
}

.search-box button {
    background-color: #007bff;
    color: #fff;
    border: 1px solid #007bff;
    padding: 8px 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.user-menu a {
    text-decoration: none;
    color: #007bff;
    margin-left: 15px;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.mobile-menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 20px;
    position: relative;
    margin-left: 20px;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    height: 2px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span:nth-child(2) {
    width: 80%; /* Shorter middle bar */
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.header-bottom {
    background-color: #e9f5ff;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #d0e7ff;
}

.header-bottom .announcement {
    margin: 0;
    color: #0056b3;
    font-size: 0.95em;
    font-weight: 500;
}

/* Footer Styles */
.main-footer {
    background-color: #222;
    color: #f8f8f8;
    padding: 50px 0;
    font-size: 0.9em;
}

.main-footer .footer-widgets {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
}

.main-footer .widget {
    flex: 1;
    min-width: 220px;
    margin: 0 15px 30px 0;
}

.main-footer .widget:last-child {
    margin-right: 0;
}

.main-footer .widget h3 {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.main-footer .widget h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: #007bff;
    border-radius: 2px;
}

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

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

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

.main-footer .widget a:hover {
    color: #007bff;
}

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

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

.main-footer .newsletter input[type="email"] {
    border: none;
    padding: 12px 18px;
    border-radius: 5px 0 0 5px;
    outline: none;
    flex-grow: 1;
    font-size: 1em;
}

.main-footer .newsletter button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1em;
}

.main-footer .newsletter button:hover {
    background-color: #0056b3;
}

.main-footer .qr-code {
    margin-top: 20px;
    text-align: center;
}

.main-footer .qr-code p {
    margin-bottom: 10px;
    color: #ccc;
}

.main-footer .qr-code img {
    max-width: 100px;
    height: auto;
    border: 2px solid #555;
    border-radius: 4px;
}

.main-footer .footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    margin-top: 30px;
    text-align: center;
    color: #aaa;
}

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

.main-footer .footer-bottom a {
    color: #007bff;
    text-decoration: none;
}

.main-footer .footer-bottom a:hover {
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-nav ul li {
        margin-left: 15px;
    }
    .search-box {
        margin-right: 10px;
    }
    .main-footer .widget {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        justify-content: center;
        padding-bottom: 0;
    }
    .logo {
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
    .header-actions {
        order: 2;
        flex-basis: 100%;
        justify-content: center;
        margin-top: 15px;
    }
    .search-box {
        margin-right: 0;
        width: 80%;
        max-width: 350px;
    }
    .search-box input {
        width: 100%;
    }
    .user-menu {
        display: none; /* Hide login/register on mobile, integrate into mobile nav if needed */
    }
    .mobile-menu-toggle {
        display: flex; /* Show mobile toggle */
        margin-left: auto; /* Push to right */
        position: absolute;
        right: 15px;
        top: 25px;
    }
    .main-nav {
        order: 3;
        flex-basis: 100%;
        margin-top: 20px;
        display: none; /* Hidden by default, toggled by JS */
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
        padding: 10px 0;
    }
    .main-nav.active {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }
    .main-nav ul li {
        margin: 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }
    .main-nav ul li:last-child {
        border-bottom: none;
    }
    .main-nav ul li a {
        padding: 15px 0;
        border-bottom: none; /* Remove desktop hover border */
    }
    .main-nav .dropdown {
        position: static;
        box-shadow: none;
        background-color: #f9f9f9;
        margin-top: 0;
        border-radius: 0;
        border: none;
        padding: 5px 0;
    }
    .main-nav .dropdown li a {
        padding: 10px 0 10px 30px;
        text-align: center;
    }
    .main-footer .footer-widgets {
        flex-direction: column;
        align-items: center;
    }
    .main-footer .widget {
        margin-right: 0;
        margin-bottom: 40px;
        text-align: center;
        width: 90%;
        max-width: 350px;
    }
    .main-footer .widget h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
    .main-footer .newsletter form {
        justify-content: center;
    }
    .main-footer .newsletter input[type="email"] {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .header-top {
        padding: 10px 0;
    }
    .logo img {
        height: 35px;
    }
    .search-box {
        width: 95%;
    }
    .mobile-menu-toggle {
        top: 18px;
    }
    .header-bottom .announcement {
        font-size: 0.85em;
        padding: 0 10px;
    }
    .main-footer .footer-widgets {
        padding: 0 10px;
    }
    .main-footer .widget {
        max-width: 95%;
    }
    .main-footer .newsletter input[type="email"] {
        width: 60%;
        padding: 10px;
    }
    .main-footer .newsletter button {
        padding: 10px 15px;
    }
    .main-footer .footer-bottom {
        padding: 20px 10px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
