/* Basic Reset & Typography */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --border-color: #dee2e6;
    --font-family-sans: 'Roboto', 'Noto Sans SC', sans-serif;
}

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

body {
    font-family: var(--font-family-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul {
    list-style: none;
}

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

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 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: #0056b3;
    border-color: #0056b3;
}

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

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

/* Header Styling */
.main-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1000;
}

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

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
}

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

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

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

.main-nav .nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

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

.main-nav li {
    position: relative;
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 5px;
    min-width: 180px;
    padding: 10px 0;
    z-index: 10;
    flex-direction: column; /* Ensure vertical display */
    gap: 0; /* Reset gap for dropdown items */
}

.main-nav li:hover > .dropdown-menu {
    display: flex;
}

.main-nav .dropdown-menu li a {
    padding: 8px 15px;
    display: block;
    color: var(--text-color);
    white-space: nowrap;
}

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

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

.header-actions button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    transition: color 0.3s ease;
}

.header-actions button:hover {
    color: var(--primary-color);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('/static/images/hero-bg.jpg') no-repeat center center/cover;
    color: #fff;
    text-align: center;
    padding: 100px 0;
    position: relative;
}

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

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-content .btn {
    margin: 0 10px;
    font-size: 1.1rem;
    padding: 12px 25px;
}

/* Main Content Area */
#main-content {
    padding: 40px 0;
    min-height: 500px; /* Ensure content area is visible */
}

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

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

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

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

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

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

.footer-section ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

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

.social-links a {
    color: #fff;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 20px;
    color: #aaa;
}

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

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

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

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .main-nav ul li:last-child {
        border-bottom: none;
    }

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

    .main-nav .dropdown-menu {
        position: static;
        box-shadow: none;
        border-radius: 0;
        background-color: var(--light-bg);
        padding: 0;
        margin-left: 20px;
        border-top: 1px solid var(--border-color);
    }

    .main-nav li:hover > .dropdown-menu {
        display: flex;
    }

    .main-nav .dropdown-menu li a {
        padding: 10px 30px;
    }

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

    .header-actions .search-btn,
    .header-actions .user-btn {
        display: none; /* Hide search/user on small screens if space is tight */
    }

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

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

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

    .footer-section ul {
        padding-left: 0;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 80px 0;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    .hero-content p {
        font-size: 0.9rem;
    }
    .hero-content .btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
}

/* Icon Font Placeholder (e.g., Font Awesome) */
/* For demonstration, these are just empty classes. In a real app, you'd link an icon font CDN. */
.icon-search::before { content: "🔍"; }
.icon-user::before { content: "👤"; }
.icon-weibo::before { content: " Weibo "; }
.icon-weixin::before { content: " WeChat "; }
.icon-linkedin::before { content: " LinkedIn "; }
.icon-twitter::before { content: " Twitter "; }
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
