/* Basic Resets & Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --light-bg: #f8f9fa;
    --dark-text: #343a40;
    --white: #ffffff;
    --header-height: 80px;
    --footer-height: auto;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    color: var(--dark-text);
    line-height: 1.6;
    background-color: var(--light-bg);
}

*, *::before, *::after {
    box-sizing: inherit;
}

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

a:hover {
    color: #0056b3;
}

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

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5em;
    color: var(--dark-text);
}

p {
    margin-top: 0;
    margin-bottom: 1em;
}

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

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    color: var(--white);
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

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

.btn-secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

.btn-lg {
    padding: 0.8rem 1.6rem;
    font-size: 1.25rem;
}

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

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

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

.logo-link {
    display: flex;
    align-items: center;
    color: var(--dark-text);
    font-size: 1.5rem;
    font-weight: bold;
}

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

.main-nav .nav-list {
    display: flex;
    gap: 1.5rem;
}

.main-nav .nav-link {
    color: var(--dark-text);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

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

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

.main-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0.25rem;
    min-width: 180px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 10;
}

.main-nav .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav .dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--dark-text);
}

.main-nav .dropdown-menu li a:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

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

.search-box {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    overflow: hidden;
}

.search-input {
    border: none;
    padding: 0.5rem 0.75rem;
    outline: none;
    flex-grow: 1;
}

.search-button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.auth-links {
    display: flex;
    gap: 0.75rem;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    z-index: 1001;
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--dark-text);
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
}

/* Hamburger menu animation */
.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 999;
    display: flex;
    justify-content: flex-end; /* Align to right for slide-in from right */
    align-items: flex-start; /* Align to top */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    background-color: var(--white);
    width: 80%;
    max-width: 300px;
    height: 100%;
    padding: 2rem;
    box-shadow: -4px 0 10px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    overflow-y: auto;
}

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

.mobile-nav-list li {
    margin-bottom: 1rem;
}

.mobile-nav-link {
    display: block;
    font-size: 1.2rem;
    color: var(--dark-text);
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

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

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

.mobile-dropdown-menu {
    display: none;
    padding-left: 1rem;
    margin-top: 0.5rem;
    border-left: 2px solid var(--primary-color);
}

.mobile-dropdown-menu li a {
    padding: 0.5rem 0;
    display: block;
    font-size: 1rem;
    color: #555;
}

/* Prevent body scroll when mobile menu is open */
body.no-scroll {
    overflow: hidden;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://via.placeholder.com/1920x600/007bff/ffffff?text=Hero+Banner') no-repeat center center/cover;
    color: var(--white);
    text-align: center;
    padding: 6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-content .btn-lg {
    margin-top: 1rem;
}

.small-text {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1.5rem;
}


/* Footer Styles */
.main-footer {
    background-color: var(--dark-text);
    color: var(--white);
    padding: 3rem 0;
    font-size: 0.9rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.footer-col h3 {
    color: var(--primary-color);
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.footer-col p {
    margin-bottom: 0.75rem;
    line-height: 1.8;
    opacity: 0.9;
}

.footer-col a {
    color: var(--white);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-col a:hover {
    color: var(--primary-color);
    opacity: 1;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.newsletter-form {
    display: flex;
    margin-top: 1rem;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid #555;
    border-radius: 0.25rem 0 0 0.25rem;
    background-color: #444;
    color: var(--white);
    outline: none;
}

.newsletter-form input::placeholder {
    color: #bbb;
}

.newsletter-form button {
    border-radius: 0 0.25rem 0.25rem 0;
    padding: 0.6rem 1rem;
    white-space: nowrap;
}

.social-links {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.social-links a {
    font-size: 1.2rem;
    color: var(--white);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.footer-bottom {
    border-top: 1px solid #444;
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-bottom p {
    margin: 0;
    opacity: 0.8;
}

.payment-partners {
    display: flex;
    gap: 10px;
}

.payment-icon {
    height: 24px;
    opacity: 0.7;
}

.back-to-top {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.2rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
    display: none; /* Hidden by default, shown by JS */
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.3s ease;
}

.back-to-top:hover {
    background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-nav {
        display: none; /* Hide main nav on smaller screens */
    }
    .header-actions {
        gap: 0.5rem;
    }
    .search-box {
        display: none; /* Hide search on smaller screens to save space */
    }
    .auth-links {
        display: none; /* Hide auth links on smaller screens */
    }
    .menu-toggle {
        display: block; /* Show hamburger menu */
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    .logo-link .site-title {
        font-size: 1.2rem;
    }
    .company-logo {
        height: 35px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col ul {
        display: inline-block; /* For centering list items */
        text-align: left;
    }
    .newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
        width: 80%;
        margin: 1rem auto;
    }
    .newsletter-form input,
    .newsletter-form button {
        border-radius: 0.25rem;
        width: 100%;
    }
    .social-links {
        justify-content: center;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
    .payment-partners {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 4rem 1rem;
        min-height: 400px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .btn-lg {
        padding: 0.6rem 1.2rem;
        font-size: 1rem;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
