/* shared_css: 网站全局共享样式 */

/* 基础样式重置 */
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, figcaption, blockquote, dl, dd, fieldset, legend, textarea, pre, iframe, hr, form, input, textarea, select, button {
    margin: 0;
    padding: 0;
}

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

/* 全局字体和颜色 */
body {
    font-family: 'Noto Sans SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

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

/* 列表样式 */
ul, ol {
    list-style: none;
}

/* 图像响应式 */
img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

/* 按钮基础样式 */
button {
    cursor: pointer;
    border: none;
    background-color: transparent;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* 容器和布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

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

.main-navigation .nav-list {
    display: flex;
    gap: 30px;
}

.main-navigation .nav-item a {
    font-weight: 500;
    color: #333;
    padding: 5px 0;
    position: relative;
}

.main-navigation .nav-item a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 0;
    height: 2px;
    background-color: #007bff;
    transition: width 0.3s ease;
}

.main-navigation .nav-item a:hover::after, 
.main-navigation .nav-item a:focus::after {
    width: 100%;
}

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

.header-actions button {
    background-color: #f0f0f0;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 14px;
    color: #555;
    transition: background-color 0.3s ease;
}

.header-actions button:hover {
    background-color: #e0e0e0;
}

/* 下拉菜单 */
.nav-item.dropdown {
    position: relative;
}

.dropdown-menu {
    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: 160px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1010;
}

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

.dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    color: #333;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: #f5f5f5;
    text-decoration: none;
}

/* 移动菜单 */
.mobile-menu-toggle {
    display: none; /* 默认隐藏 */
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 1020;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
}

.mobile-menu-overlay.open {
    transform: translateX(0);
}

.mobile-menu-overlay .close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: #fff;
    background: none;
    border: none;
}

.mobile-nav-list {
    text-align: center;
    padding: 0;
}

.mobile-nav-list li {
    margin-bottom: 20px;
}

.mobile-nav-list li a {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    padding: 10px 20px;
    display: block;
    transition: color 0.3s ease;
}

.mobile-nav-list li a:hover {
    color: #007bff;
    text-decoration: none;
}

/* 页脚样式 */
.main-footer {
    background-color: #222;
    color: #bbb;
    padding: 50px 0 20px;
    font-size: 14px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-section h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 40px;
    height: 2px;
    background-color: #007bff;
}

.footer-section p, .footer-section ul {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li a {
    color: #bbb;
    display: block;
    padding: 5px 0;
}

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

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

.social-links img {
    width: 30px;
    height: 30px;
    filter: brightness(0.8) invert(1);
    transition: filter 0.3s ease;
}

.social-links a:hover img {
    filter: brightness(1) invert(0);
}

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

.newsletter input[type="email"] {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #555;
    border-radius: 5px 0 0 5px;
    background-color: #333;
    color: #fff;
}

.newsletter input[type="email"]:focus {
    outline: none;
    border-color: #007bff;
}

.newsletter button[type="submit"] {
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 0 5px 5px 0;
    transition: background-color 0.3s ease;
}

.newsletter button[type="submit"]:hover {
    background-color: #0056b3;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #333;
}

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

.footer-bottom a {
    color: #007bff;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* 媒体查询 - 响应式设计 */
@media (max-width: 992px) {
    .main-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-actions .search-button, .header-actions .lang-selector {
        display: none; /* 在移动端可以隐藏或放入移动菜单 */
    }

    .header-container {
        padding: 0 15px;
    }

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

    .footer-section h3::after {
        left: 50%;
        transform: translateX(-50%);
    }

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

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

/* 通用图标样式 (假设使用字体图标) */
.icon-search::before {
    content: '\f002'; /* Font Awesome search icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

.icon-menu::before {
    content: '\f0c9'; /* Font Awesome bars icon */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}

/* 滚动到顶部按钮 */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Cookie 同意横幅 */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    z-index: 10000;
    font-size: 14px;
}

#cookie-consent-banner p {
    margin: 0;
    flex-grow: 1;
    margin-right: 20px;
}

#cookie-consent-banner a {
    color: #007bff;
    text-decoration: underline;
}

#cookie-consent-banner button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#cookie-consent-banner button:hover {
    background-color: #0056b3;
}

@media (max-width: 768px) {
    #cookie-consent-banner {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    #cookie-consent-banner p {
        margin-right: 0;
    }
}

/* Lazy load images placeholder */
img.lazyload {
    background-color: #e0e0e0;
    min-height: 50px; /* Placeholder height */
    display: block;
}

/* 更多通用组件和实用程序样式可以在此处添加 */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

/* Utility classes for spacing, colors, etc. */
.d-flex {
    display: flex;
}
.justify-content-center {
    justify-content: center;
}
.align-items-center {
    align-items: center;
}
.text-primary {
    color: #007bff;
}
.bg-light {
    background-color: #f8f9fa;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* End of shared_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;
  }
}
