/* Global styles for the entire application */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --accent-color: #28a745;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --border-color: #dee2e6;
    --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --header-height: 70px;
    --footer-height: auto;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
    -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: #0056b3;
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 5px;
    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: #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: #5a6268;
}

/* Header specific styles */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top-bar {
    background-color: var(--dark-bg);
    color: #fff;
    padding: 8px 0;
    font-size: 0.9rem;
    text-align: center;
}

.header-top-bar .learn-more {
    color: #fff;
    text-decoration: underline;
}

.header-main-content {
    padding: 15px 0;
}

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

.site-branding {
    display: flex;
    align-items: center;
}

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

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-bg);
}

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

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

.main-nav .nav-menu a:hover {
    color: var(--primary-color);
}

.main-nav .menu-item-has-children > a::after {
    content: '▾';
    margin-left: 5px;
}

.main-nav .sub-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 10px 0;
    min-width: 200px;
    z-index: 10;
    border-radius: 5px;
}

.main-nav .menu-item-has-children:hover > .sub-menu {
    display: block;
}

.main-nav .sub-menu li a {
    padding: 8px 15px;
    display: block;
    white-space: nowrap;
}

.menu-toggle {
    display: none; /* Hidden by default, shown on smaller screens */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    color: var(--text-color);
}

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

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

.search-box input {
    border: none;
    padding: 8px 10px;
    outline: none;
    font-size: 0.9rem;
}

.search-box button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

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

.header-bottom-bar {
    background-color: var(--light-bg);
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* Footer specific styles */
.site-footer {
    background-color: var(--dark-bg);
    color: #f8f9fa;
    padding-top: 40px;
    font-size: 0.9rem;
}

.footer-widgets-area {
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.footer-widget h3 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
}

.footer-widget h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    margin-top: 10px;
}

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

.footer-widget ul {
    margin-bottom: 15px;
}

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

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

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

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

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

address p {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

address p i {
    margin-right: 10px;
    color: var(--primary-color);
}

address p a {
    color: #f8f9fa;
}

address p a:hover {
    color: var(--primary-color);
}

.newsletter-form {
    display: flex;
    margin-top: 20px;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 5px 0 0 5px;
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.7);
}

.newsletter-form .btn-subscribe {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    border-radius: 0 5px 5px 0;
    padding: 10px 15px;
}

.newsletter-form .btn-subscribe:hover {
    background-color: #218838;
    border-color: #218838;
}

.footer-bottom-bar {
    background-color: #212529;
    padding: 20px 0;
    text-align: center;
}

.footer-bottom-bar p {
    margin: 0;
    color: rgba(255,255,255,0.7);
}

.powered-by {
    color: var(--primary-color);
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .main-nav .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: var(--header-height); /* Adjust based on actual header height */
        left: 0;
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 10px 0;
    }
    .main-nav .nav-menu.active {
        display: flex;
    }
    .main-nav .menu-toggle {
        display: block;
    }
    .main-nav .nav-menu li {
        width: 100%;
        text-align: center;
    }
    .main-nav .nav-menu a {
        padding: 10px 15px;
        display: block;
    }
    .main-nav .sub-menu {
        position: static;
        box-shadow: none;
        background-color: var(--light-bg);
        padding: 5px 0;
        width: 100%;
    }
    .header-actions {
        order: -1; /* Move actions to the left on smaller screens if needed */
        margin-bottom: 15px;
        width: 100%;
        justify-content: center;
    }
    .site-branding {
        flex-grow: 1;
        justify-content: center;
    }
    .header-main-content .flex-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }
    .footer-widget {
        text-align: center;
    }
    .footer-widget h3::after {
        margin-left: auto;
        margin-right: auto;
    }
    .social-links {
        text-align: center;
        margin-top: 20px;
    }
    .newsletter-form {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* FontAwesome icons for demonstration */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
