/* Basic Reset and Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #333;
    --heading-color: #222;
    --border-color: #dee2e6;
    --bg-light: #f4f7f6;
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

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

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

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;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 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;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.2;
}

p {
    margin-bottom: 1rem;
}

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

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    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;
}

.btn:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #0056b3;
    text-decoration: none;
}

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

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

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

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

/* Forms */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea {
    display: block;
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="search"] {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

input:focus, textarea:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.clearfix::after {
    display: block;
    clear: both;
    content: "";
}

/* Header Specific Styles (example, usually in main CSS) */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.header-top-bar {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 8px 0;
    font-size: 0.85rem;
}

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

.header-top-bar .top-nav ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.header-top-bar .top-nav li {
    position: relative;
    margin-left: 20px;
}

.header-top-bar .top-nav a {
    color: var(--light-color);
    text-decoration: none;
    padding: 5px 0;
    display: block;
}

.header-top-bar .top-nav a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.header-top-bar .dropdown {
    display: none;
    position: absolute;
    background-color: var(--dark-color);
    min-width: 120px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    list-style: none;
    padding: 10px 0;
    margin-top: 5px;
    border-radius: 4px;
}

.header-top-bar .language-selector:hover .dropdown {
    display: block;
}

.header-top-bar .dropdown li a {
    color: var(--light-color);
    padding: 8px 15px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.header-top-bar .dropdown li a:hover {
    background-color: #555;
    color: var(--primary-color);
}

.header-main-area {
    padding: 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

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

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

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

.logo-section .tagline {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin: 0;
    padding-left: 15px;
    border-left: 1px solid var(--border-color);
}

.main-navigation ul {
    display: flex;
    margin: 0;
    padding: 0;
}

.main-navigation .nav-item {
    position: relative;
    margin-left: 30px;
}

.main-navigation .nav-item > a {
    display: block;
    padding: 10px 0;
    font-weight: 500;
    color: var(--heading-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-navigation .nav-item > a:hover {
    color: var(--primary-color);
}

.main-navigation .nav-item.has-dropdown > a i {
    margin-left: 5px;
    font-size: 0.8em;
}

.main-navigation .dropdown-menu {
    display: none;
    position: absolute;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 200px;
    padding: 20px;
    border-radius: 5px;
    margin-top: 10px;
    left: 0;
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.main-navigation .mega-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 900px; /* Adjust as needed */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.main-navigation .mega-menu-column h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.main-navigation .mega-menu-column ul {
    display: block; /* Override flex */
}

.main-navigation .mega-menu-column li {
    margin-left: 0;
    margin-bottom: 10px;
}

.main-navigation .mega-menu-column li a {
    color: var(--text-color);
    font-weight: 400;
    padding: 0;
}

.main-navigation .mega-menu-column li a:hover {
    color: var(--primary-color);
}

.main-navigation .mega-menu-promo {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.main-navigation .mega-menu-promo h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.main-navigation .mega-menu-promo p {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

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

.header-actions .search-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    overflow: hidden;
}

.header-actions .search-form input {
    border: none;
    padding: 8px 12px;
    font-size: 0.9rem;
    width: 180px;
}

.header-actions .search-form input:focus {
    box-shadow: none;
    border-color: transparent;
}

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

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

.header-actions .cart-icon {
    position: relative;
    color: var(--heading-color);
    font-size: 1.3rem;
}

.header-actions .cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: #fff;
    font-size: 0.7rem;
    border-radius: 50%;
    padding: 2px 6px;
    line-height: 1;
}

.header-actions .user-auth {
    display: flex;
    gap: 10px;
}

.header-bottom-banner {
    background-color: var(--primary-color);
    color: #fff;
    padding: 10px 0;
    text-align: center;
    font-size: 0.9rem;
}

.header-bottom-banner a {
    color: #fff;
    text-decoration: underline;
    font-weight: 500;
}

.header-bottom-banner a:hover {
    color: #e0e0e0;
}

/* Footer Specific Styles */
.site-footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 60px 0 30px;
    font-size: 0.9rem;
    line-height: 1.8;
}

.site-footer a {
    color: var(--light-color);
    text-decoration: none;
}

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

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

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

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

.site-footer .footer-widget ul {
    padding: 0;
    margin: 0;
}

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

.site-footer .footer-logo img {
    margin-bottom: 15px;
}

.site-footer .about-us p {
    margin-bottom: 20px;
}

.site-footer .contact-info p {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.site-footer .contact-info i {
    margin-right: 10px;
    color: var(--primary-color);
    font-size: 1rem;
}

.site-footer .newsletter-form {
    display: flex;
    margin-top: 15px;
    margin-bottom: 20px;
}

.site-footer .newsletter-form input {
    flex-grow: 1;
    border: none;
    padding: 10px 15px;
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
    color: var(--dark-color);
}

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

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

.site-footer .social-links {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.site-footer .social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.site-footer .social-links a:hover {
    background-color: var(--primary-color);
    color: #fff;
}

.site-footer .footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
    margin-top: 30px;
    font-size: 0.85rem;
}

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

/* Responsive adjustments */
@media (max-width: 992px) {
    .header-main-area .container {
        flex-wrap: wrap;
        justify-content: center;
    }
    .logo-section, .main-navigation, .header-actions {
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    .logo-section .tagline {
        display: none;
    }
    .main-navigation ul {
        justify-content: center;
        flex-wrap: wrap;
    }
    .main-navigation .nav-item {
        margin: 0 15px 10px;
    }
    .header-actions {
        justify-content: center;
    }
    .main-navigation .mega-menu {
        grid-template-columns: 1fr;
        width: auto;
        left: 0;
        transform: none;
        position: static;
        box-shadow: none;
        border-top: 1px solid #eee;
        margin-top: 10px;
        padding-top: 10px;
    }
    .main-navigation .nav-item.has-dropdown:hover .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: block;
        box-shadow: none;
    }
    .site-footer .footer-widgets {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-top-bar .top-bar-content {
        flex-direction: column;
        text-align: center;
    }
    .header-top-bar .top-nav ul {
        margin-top: 10px;
    }
    .header-top-bar .top-nav li {
        margin: 0 10px;
    }
    .main-navigation ul {
        flex-direction: column;
        align-items: center;
    }
    .main-navigation .nav-item {
        margin: 0 0 10px 0;
    }
    .header-actions .search-form {
        width: 100%;
    }
    .header-actions .search-form input {
        width: calc(100% - 40px); /* Adjust button width */
    }
    .header-actions .user-auth {
        flex-grow: 1;
        justify-content: center;
    }
    .site-footer .footer-widgets {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .site-footer .footer-widget h3::after {
        margin-left: auto;
        margin-right: auto;
    }
    .site-footer .contact-info p {
        justify-content: center;
    }
    .site-footer .newsletter-form {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    .site-footer .social-links {
        justify-content: center;
    }
}
/* 移动端内容区防溢出（系统追加，请勿删除） */
@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;
  }
}
