/* General Body and Typography */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333;
    --light-text-color: #666;
    --bg-light: #f8f9fa;
    --bg-dark: #343a40;
    --border-color: #dee2e6;
    --font-family-sans-serif: 'Roboto', 'Open Sans', sans-serif;
    --font-family-monospace: 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    --container-max-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans-serif);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 15px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-sans-serif);
    margin-bottom: 0.5em;
    font-weight: 700;
    color: var(--text-color);
}

p {
    margin-bottom: 1em;
}

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

a:hover {
    color: #0056b3; /* Darken primary color */
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

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

.btn-primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

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

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

.btn-hero {
    font-size: 1.1em;
    padding: 12px 25px;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.btn-hero:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

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

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

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: 700;
}

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

.company-name {
    display: none; /* Hidden by default for small screens */
}

.main-nav .nav-list {
    display: flex;
    align-items: center;
}

.nav-item {
    position: relative;
    margin-left: 25px;
}

.nav-link {
    padding: 8px 0;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    margin-top: 5px;
    right: 0;
    background: var(--primary-color);
    transition: width 0.3s ease;
    -webkit-transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    left: 0;
    background: var(--primary-color);
}

.nav-link.btn {
    margin-left: 20px;
    padding: 8px 15px;
    font-weight: 600;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    border-radius: 5px;
    padding: 10px 0;
}

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

.dropdown-menu li {
    padding: 0;
}

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

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    text-decoration: none;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('/static/hero-bg.jpg') no-repeat center center/cover;
    color: #fff;
    padding: 100px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.hero-content h1 {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: #fff;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.hero-subtext {
    font-size: 1em;
    margin-top: 40px;
    opacity: 0.8;
}

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

.footer-container {
    display: flex;
    flex-direction: column;
}

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

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

.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: #fff;
    text-decoration: underline;
}

.footer-col.company-info .logo {
    margin-bottom: 15px;
}

.footer-col.company-info .logo-img {
    height: 35px;
}

.footer-col.company-info .company-name {
    color: #fff;
    font-size: 1.4em;
    display: inline-block; /* Make it visible in footer */
}

.footer-col.company-info p {
    color: #ccc;
    margin-bottom: 20px;
}

.social-links a {
    display: inline-block;
    color: #fff;
    font-size: 1.2em;
    margin-right: 15px;
    transition: color 0.3s ease;
}

.social-links 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: none;
    border-radius: 5px 0 0 5px;
    outline: none;
}

.newsletter-form button {
    border-radius: 0 5px 5px 0;
    padding: 10px 15px;
    border: none;
    background-color: var(--primary-color);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #0069d9;
}

.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: #ccc;
    margin-bottom: 5px;
}

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

.footer-bottom a:hover {
    color: #fff;
}

/* Back to Top Button */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#back-to-top:hover {
    background-color: #0069d9;
    transform: translateY(-3px);
}

/* Utility classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .main-nav .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 8px 16px rgba(0,0,0,0.1);
        padding: 10px 0;
    }

    .main-nav.active .nav-list {
        display: flex;
    }

    .nav-item {
        margin: 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--bg-light);
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        padding: 15px 20px;
        display: block;
        width: 100%;
    }

    .nav-link.btn {
        margin: 10px auto;
        width: auto;
    }

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

    .menu-toggle {
        display: block;
    }

    .company-name {
        display: inline-block; /* Show company name on smaller screens for header */
    }

    .nav-item.dropdown:hover .dropdown-menu,
    .nav-item.dropdown .dropdown-menu { /* Handle dropdowns for mobile */
        position: static;
        box-shadow: none;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        background-color: var(--bg-light);
        padding: 0;
        margin-top: 5px;
    }

    .nav-item.dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding-left: 40px;
    }

    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-content p {
        font-size: 1em;
    }

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

    .footer-col.company-info .logo {
        justify-content: center;
    }

    .social-links {
        margin-top: 20px;
    }

    .newsletter-form {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0;
        min-height: 400px;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .hero-content p {
        font-size: 0.9em;
    }

    .main-footer {
        padding: 40px 0 15px;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
