/* ============================================
   HEADER STYLES
   ============================================ */

:root {
    --header-height: 0px; /* JavaScript会动态设置 */
}

body {
    padding-top: var(--header-height) !important; /* 使用!important确保生效 */
    transition: padding-top 0s; /* 防止padding动画 */
}


/* 头部容器 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--header-bg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    will-change: transform;
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.site-header.hide-header {
    transform: translateY(-100%);
}

.site-header.transparent {
    background-color: transparent;
    box-shadow: none;
}

.site-header.transparent.scrolled {
    background-color: var(--header-bg);
    box-shadow: var(--shadow-md);
}

/* 顶部栏容器 */
.header-top {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 0.75rem 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ============================================
   联系信息区域
   ============================================ */

.contact-section {
    display: flex;
    align-items: center;
}

.header-contact-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: nowrap;
}

.contact-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.contact-item i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
    min-width: 16px;
    text-align: center;
}

.contact-item a {
    color: var(--white);
    text-decoration: none;
    transition: opacity var(--transition-fast);
    font-weight: 500;
}

.contact-item a:hover {
    opacity: 0.9;
    text-decoration: underline;
}

/* ============================================
   额外内容区域（语言+社交链接）
   ============================================ */

.extra-section {
    display: flex;
    align-items: center;
}

.header-extra {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ============================================
   语言切换器样式
   ============================================ */

.language-switcher {
    position: relative;
}

/* 语言选择器 */
.language-switcher select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.375rem 0.75rem;
    padding-right: 2rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    min-width: 120px;
}

.language-switcher select:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--white);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* 语言选项 */
.language-switcher option {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 0.5rem;
}

/* ============================================
   社交链接样式
   ============================================ */

.social-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    position: relative;
}

.social-icon:hover {
    background: var(--white);
    color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 社交图标悬停提示 */
.social-icon::after {
    content: attr(aria-label);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--white);
    color: var(--text-dark);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 10001;
    box-shadow: var(--shadow-sm);
	pointer-events: none; /* 防止提示干扰交互 */
	min-width: 80px;
	text-align: center;
	font-weight: 500;
}

.social-icon:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* ============================================
   Polylang 语言切换器样式
   ============================================ */

/* 如果使用Polylang插件的下拉菜单 */
.language-switcher .polylang-dropdown {
    position: relative;
}

.language-switcher .polylang-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.language-switcher .polylang-dropdown-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.language-switcher .polylang-dropdown-toggle img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

.language-switcher .polylang-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 140px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    z-index: 1000;
    display: none;
}

.language-switcher:hover .polylang-dropdown-menu {
    display: block;
}

.language-switcher .polylang-dropdown-menu li {
    list-style: none;
}

.language-switcher .polylang-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.language-switcher .polylang-dropdown-menu a:hover {
    background-color: var(--light-gray);
}

.language-switcher .polylang-dropdown-menu img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
}

/* 主头部区域 */
.header-main {
    padding: 1rem 0;
    background-color: var(--header-bg);
}

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

/* 网站品牌 */
.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.custom-logo-link {
    display: block;
}

.custom-logo {
    height: 50px;
    width: auto;
    transition: transform var(--transition-normal);
}

.custom-logo:hover {
    transform: scale(1.05);
}

.site-description {
    display: none;
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 主导航菜单 */
.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu > .menu-item {
    position: relative;
}

.nav-menu > .menu-item > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem; /* 增加内边距 */
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

.nav-menu > .menu-item.current-menu-item > a,
.nav-menu > .menu-item.current-menu-ancestor > a {
    color: var(--primary-color);
}

/* 下拉菜单 */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    z-index: 1000;
	list-style: none; /* 移除列表标记 */
	margin: 0; /* 移除默认边距 */
}

.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu .menu-item {
    position: relative;
	margin: 0; /* 移除默认边距 */
}

.sub-menu .menu-item a {
    display: block;
    padding: 0.625rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.sub-menu .menu-item a:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
    padding-left: 2rem;
}

/* 下拉菜单指示器 */
.menu-item-has-children > a::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    margin-left: 0.25rem;
    transition: transform var(--transition-fast);
}

.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* 三级菜单 */
.sub-menu .sub-menu {
    top: -0.75rem;
    left: 100%;
    margin-left: 0.25rem;
}

.sub-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: 1rem;
    left: -0.5rem;
    width: 0.5rem;
    height: 100%;
}

/* 头部操作按钮 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions .btn {
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    color: var(--white);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25);
    position: relative;
    overflow: hidden;
}

.search-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.4);
}

.search-toggle:hover::before {
    opacity: 1;
}

.search-toggle i {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.search-toggle:hover i {
    transform: rotate(15deg);
}

/* 透明头部时 - 白色背景+蓝色图标 */
.homepage-template .site-header.transparent .search-toggle {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.homepage-template .site-header.transparent .search-toggle::before {
    background: var(--white);
}

.homepage-template .site-header.transparent .search-toggle:hover {
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.3);
    transform: scale(1.1);
}

.homepage-template .site-header.transparent .search-toggle:hover i {
    transform: rotate(0deg);
}

/* 滚动后恢复 */
.homepage-template .site-header.transparent.scrolled .search-toggle {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25);
}

/* 搜索表单 */
.header-search {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    border-top: 3px solid var(--primary-color);
}

.header-search.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

/* 透明头部时搜索框背景 */
.homepage-template .site-header.transparent .header-search {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.95) 100%);
    border-top-color: #4fc3f7;
    backdrop-filter: blur(20px);
}

.homepage-template .site-header.transparent .search-form-wrapper .search-field {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.homepage-template .site-header.transparent .search-form-wrapper .search-field::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.homepage-template .site-header.transparent .search-form-wrapper .search-field:focus {
    border-color: #4fc3f7;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(79, 195, 247, 0.15), 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.homepage-template .site-header.transparent .search-form-wrapper .search-submit {
    background: linear-gradient(135deg, #4fc3f7 0%, #0288d1 100%);
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.3);
}

.homepage-template .site-header.transparent .search-form-wrapper .search-submit:hover {
    background: linear-gradient(135deg, #0288d1 0%, #4fc3f7 100%);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.4);
}

.homepage-template .site-header.transparent .search-close {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.homepage-template .site-header.transparent .search-close:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.homepage-template .site-header.transparent .search-shortcut-hint kbd {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
}

.search-form-wrapper {
    position: relative;
    padding: 1.5rem 0;
}

.search-form-wrapper .search-form {
    position: relative;
    max-width: 650px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-form-wrapper .search-field {
    width: 100%;
    padding: 18px 24px;
    padding-left: 56px;
    padding-right: 130px;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.search-form-wrapper .search-field::placeholder {
    color: #94a3b8;
}

.search-form-wrapper .search-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1), 0 10px 25px -5px rgba(0, 86, 179, 0.15);
}

/* 快捷键提示 */
.search-shortcut-hint {
    position: absolute;
    right: 140px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-shortcut-hint kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-family: inherit;
    color: #64748b;
    font-weight: 600;
}

.search-form-wrapper .search-field:focus ~ .search-shortcut-hint,
.homepage-template .site-header.transparent .search-shortcut-hint {
    opacity: 0;
    visibility: hidden;
}

.search-form-wrapper .search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 8px);
    min-width: 110px;
    padding: 0 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #003d82 100%);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.25);
}

.search-form-wrapper .search-submit i {
    font-size: 0.9rem;
}

.search-form-wrapper .search-submit:hover {
    background: linear-gradient(135deg, #003d82 0%, var(--primary-color) 100%);
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.35);
}

.search-close {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    color: #64748b;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-close:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-50%) rotate(90deg);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* 移动端菜单切换按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.menu-toggle-bar {
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-toggle.active .menu-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active .menu-toggle-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}



/* 移动端菜单样式 */
@media (max-width: 991.98px) {
    /* 隐藏顶部栏 */
    .header-top {
        display: none;
    }
    
    /* 移动端菜单切换按钮 */
    .menu-toggle {
        display: flex;
    }
    
    /* 主导航菜单 */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: var(--white);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        padding: 80px 2rem 2rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu > .menu-item {
        width: 100%;
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-menu > .menu-item:last-child {
        border-bottom: none;
    }
    
    .nav-menu > .menu-item > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 0;
        width: 100%;
        font-size: 1.1rem;
    }
    
    /* 下拉菜单（移动端） */
    .sub-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        background: var(--light-gray);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 0.3s ease;
    }
    
    .sub-menu.active {
        max-height: 500px;
        padding: 0.5rem 0;
    }
    
    .sub-menu .menu-item a {
        padding: 0.75rem 1.5rem;
        padding-left: 2rem;
    }
    
    .sub-menu .sub-menu .menu-item a {
        padding-left: 3rem;
    }
    
    /* 下拉菜单指示器（移动端） */
    .menu-item-has-children > a::after {
        content: '\f078';
        transition: transform 0.3s ease;
    }
    
    .menu-item-has-children.active > a::after {
        transform: rotate(180deg);
    }
    
    /* 头部操作按钮调整 */
    .header-actions {
        gap: 0.5rem;
    }
    
    .header-actions .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .search-toggle {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    /* 搜索表单（移动端） */
    .header-search.active {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        transform: none;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1.5rem;
    }
    
    .search-form-wrapper {
        width: 100%;
        max-width: 100%;
    }
    
    .search-input-wrapper {
        position: relative;
    }
    
    .search-form-wrapper .search-field {
        padding: 16px 20px;
        padding-left: 50px;
        padding-right: 90px;
        font-size: 1rem;
        border-radius: 14px;
    }
    
    .search-shortcut-hint {
        display: none;
    }
    
    .search-form-wrapper .search-submit {
        padding: 0 16px;
        font-size: 0.9rem;
        min-width: auto;
        border-radius: 10px;
    }
    
    .search-form-wrapper .search-submit span {
        display: none;
    }
    
    .search-form-wrapper .search-submit i {
        font-size: 1rem;
    }
    
    .search-close {
        right: 12px;
        width: 38px;
        height: 38px;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .header-top-inner {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
    }
    
    .contact-section,
    .extra-section {
        width: 100%;
        justify-content: center;
    }
    
    .header-contact-info {
        gap: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .header-extra {
        gap: 1.5rem;
        justify-content: center;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .language-switcher select {
        min-width: 100px;
        padding: 0.25rem 0.5rem;
        padding-right: 1.75rem;
        font-size: 0.8rem;
    }
}

/* ============================================
   小屏幕优化
   ============================================ */

@media (max-width: 576px) {
    .header-top {
        padding: 0.5rem 0;
    }
    
    .header-contact-info {
        flex-direction: row;
        gap: 0.75rem;
        font-size: 0.8rem;
    }
    
    .contact-item i {
        margin-right: 0.25rem;
    }
    
    .header-extra {
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .social-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .social-icon::after {
        display: none; /* 小屏幕隐藏悬停提示 */
    }
}

/* ============================================
   极窄屏幕优化
   ============================================ */

@media (max-width: 400px) {
    .header-contact-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header-extra {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .social-links {
        gap: 0.25rem;
    }
}

/* ============================================
   暗色模式支持
   ============================================ */

@media (prefers-color-scheme: dark) {
    .language-switcher select {
        background-color: rgba(0, 0, 0, 0.3);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .social-icon {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* ============================================
   无障碍支持
   ============================================ */

/* 键盘导航焦点样式 */
.language-switcher select:focus-visible,
.social-icon:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* 减少运动支持 */
@media (prefers-reduced-motion: reduce) {
    .contact-item,
    .social-icon,
    .language-switcher select {
        transition: none;
    }
    
    .social-icon:hover {
        transform: none;
    }
}

/* 头部固定时页面内容偏移 */
body.menu-open {
    overflow: hidden;
}

body.scrolled-down {
    padding-top: var(--header-height);
}

body.scrolled-down .site-header {
    background-color: var(--header-bg);
    box-shadow: var(--shadow-md);
}

/* 头部透明模式（用于首页） */
.homepage-template .site-header.transparent {
    background-color: transparent;
    box-shadow: none;
}

.homepage-template .site-header.transparent .header-main {
    background-color: transparent;
}

.homepage-template .site-header.transparent .nav-menu > .menu-item > a,
.homepage-template .site-header.transparent .search-toggle,
.homepage-template .site-header.transparent .header-actions .btn {
    color: var(--white);
}

.homepage-template .site-header.transparent .search-toggle:hover,
.homepage-template .site-header.transparent .header-actions .btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.homepage-template .site-header.transparent .custom-logo-link img {
    filter: brightness(0) invert(1);
}

.homepage-template .site-header.transparent.scrolled .header-main {
    background-color: var(--header-bg);
}

.homepage-template .site-header.transparent.scrolled .nav-menu > .menu-item > a,
.homepage-template .site-header.transparent.scrolled .search-toggle,
.homepage-template .site-header.transparent.scrolled .header-actions .btn {
    color: var(--text-dark);
}

.homepage-template .site-header.transparent.scrolled .custom-logo-link img {
    filter: none;
}

/* 头部动画效果 */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

.site-header.scrolled {
    animation: slideDown 0.3s ease;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .site-header {
        border-bottom: 2px solid var(--primary-color);
    }
    
    .nav-menu > .menu-item > a {
        font-weight: 700;
    }
    
    .sub-menu {
        border: 2px solid var(--primary-color);
    }
}

/* 减少运动模式 */
@media (prefers-reduced-motion: reduce) {
    .site-header,
    .nav-menu,
    .sub-menu,
    .search-toggle,
    .contact-item a,
    .social-links .social-menu a,
    .custom-logo,
    .menu-toggle-bar {
        transition: none;
    }
    
    .site-header.scrolled {
        animation: none;
    }
}

/* ============================================
   SINGLE CASE STUDY STYLES
   ============================================ */

/* 案例头部 */
.single-case-study-template .case-header-section {
    padding: 4rem 0 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-light);
}

.case-breadcrumb .breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.case-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.case-breadcrumb .breadcrumb-item.active {
    color: var(--text-secondary);
}

.case-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.case-industry-tag,
.case-year-tag,
.case-impact-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.case-industry-tag {
    background: var(--primary-lightest);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

.case-year-tag {
    background: var(--light-gray);
    color: var(--text-secondary);
}

.case-impact-tag {
    border: none;
    color: var(--white);
}

.case-impact-tag.impact-high {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.case-impact-tag.impact-critical {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.case-impact-tag.impact-medium {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

.case-title {
    color: var(--text-dark);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.case-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.case-excerpt.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 800px;
}

.case-quick-stats {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.stats-title {
    color: var(--text-dark);
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.stat-item .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 案例特色图片 */
.case-hero-image-section {
    padding: 2rem 0 3rem;
}

.case-featured-image-wrapper {
    position: relative;
}

.case-featured-image {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
}

.case-featured-image img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.case-featured-image:hover img {
    transform: scale(1.02);
}

.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

/* 案例主要内容 */
.case-main-content-section {
    background: var(--white);
}

.section-header {
    position: relative;
}

.section-title {
    color: var(--text-dark);
    font-weight: 700;
    padding-bottom: 1rem;
}

.title-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-content {
    line-height: 1.8;
    color: var(--text-secondary);
}

.section-content h3,
.section-content h4 {
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.section-content p {
    margin-bottom: 1.5rem;
}

.section-content ul,
.section-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.section-content li {
    margin-bottom: 0.5rem;
}

/* 客户评价 */
.client-quote-wrapper {
    margin: 2rem 0;
}

.client-quote {
    border-left: none !important;
    background: linear-gradient(135deg, var(--primary-lightest) 0%, #ffffff 100%);
}

.quote-icon-top,
.quote-icon-bottom {
    color: var(--primary-light);
    font-size: 1.5rem;
}

.quote-icon-top {
    margin-bottom: 1rem;
}

.quote-icon-bottom {
    margin-top: 1rem;
}

.quote-content {
    font-size: 1.1rem !important;
    color: var(--text-dark) !important;
    line-height: 1.7;
}

.quote-author {
    border-top: 1px solid var(--border-light);
}

.author-avatar {
    flex-shrink: 0;
}

.author-name {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.author-company {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 详细统计 */
.detailed-statistics .stat-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: all var(--transition-normal);
    height: 100%;
}

.detailed-statistics .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.detailed-statistics .stat-icon {
    margin-bottom: 1rem;
}

.detailed-statistics .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.detailed-statistics .stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* 图片库 */
.case-gallery {
    border-top: 2px solid var(--border-light);
}

.gallery-grid .gallery-item {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.gallery-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.gallery-image-wrapper img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 86, 179, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-overlay i {
    color: var(--white);
    font-size: 2rem;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-image-wrapper img {
    transform: scale(1.05);
}

/* 侧边栏 */
.case-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-widget .card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    padding: 1rem 1.5rem;
}

.case-info-list .info-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.case-info-list .info-value {
    padding-left: 1.75rem;
    color: var(--text-dark);
}

.impact-badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.impact-badge.impact-high {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.impact-badge.impact-critical {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.impact-badge.impact-medium {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.2);
}

/* 下载列表 */
.downloads-list .download-item {
    text-decoration: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.downloads-list .download-item:hover {
    background: var(--light-gray);
    border-color: var(--border-color);
    text-decoration: none;
}

.download-title {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.125rem;
}

/* 社交分享 */
.social-share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.social-share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.social-share-btn.facebook {
    background: #3b5998;
}

.social-share-btn.twitter {
    background: #1da1f2;
}

.social-share-btn.linkedin {
    background: #0077b5;
}

.social-share-btn.email {
    background: var(--primary-color);
}

.social-share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--white);
}

/* CTA卡片 */
.cta-card .card {
    border: 2px solid var(--primary-color) !important;
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-lightest) 100%);
}

.cta-icon {
    color: var(--primary-color);
}

.cta-card .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

/* 相关案例 */
.related-cases-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.section-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.related-case-card {
    transition: all var(--transition-normal);
    overflow: hidden;
}

.related-case-card.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg) !important;
}

.related-case-card .card-img-top {
    height: 200px;
    overflow: hidden;
}

.related-case-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-case-card:hover img {
    transform: scale(1.05);
}

.placeholder-image {
    height: 100%;
    width: 100%;
}

.industry-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.related-case-meta {
    font-size: 0.875rem;
}

.country-badge,
.year-badge {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
}

.related-case-card .card-title a:hover {
    color: var(--primary-color);
}

.related-case-card .stretched-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* 全局CTA */
.case-global-cta {
    color: var(--white);
}

.case-global-cta h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.case-global-cta .btn-light {
    background: var(--white);
    color: var(--primary-dark);
    font-weight: 600;
    border: none;
    transition: all var(--transition-fast);
}

.case-global-cta .btn-light:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .case-header-section {
        padding: 3rem 0 2rem;
    }
    
    .case-title.display-4 {
        font-size: 2.5rem;
    }
    
    .case-quick-stats {
        margin-top: 2rem;
    }
    
    .case-sidebar {
        position: static;
        margin-top: 3rem;
    }
}

@media (max-width: 767.98px) {
    .case-title.display-4 {
        font-size: 2rem;
    }
    
    .case-excerpt.lead {
        font-size: 1.125rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .case-tags {
        gap: 0.5rem;
    }
    
    .case-industry-tag,
    .case-year-tag,
    .case-impact-tag {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .social-share-buttons {
        grid-template-columns: 1fr;
    }
    
    .social-share-btn {
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .case-header-section {
        padding: 2rem 0 1.5rem;
    }
    
    .case-title.display-4 {
        font-size: 1.75rem;
    }
    
    .detailed-statistics .row {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid .row {
        grid-template-columns: 1fr;
    }
}