/* 
@tailwind base;
@tailwind components;
@tailwind utilities;
*/

/* 全局样式 */
:root {
    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --brand-color: #CE2C56; /* Lower saturation rose red */
    --brand-color-hover: #B01E43;
    --brand-color-light: rgba(206, 44, 86, 0.2);
}

/* Header Styles */
header {
    background-color: transparent;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* 强制统一导航栏文字大小 - 所有页面 */
header nav .hidden.md\:flex {
    font-size: 12px !important;
    font-weight: 500 !important;
}

header nav .hidden.md\:flex > a {
    font-size: 14px !important;
    font-weight: 500 !important;
}

header .nav-link-hover,
header #langBtn,
header .nav-info-text {
    color: rgba(255, 255, 255, 0.95);
}

header #langBtn {
    border-color: rgba(255, 255, 255, 0.4);
}

header #langBtn:hover {
    border-color: #f97316;
    color: #f97316;
}

header .mobile-menu-btn {
    color: white;
}

/* Scrolled Header State */
header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

header.scrolled .nav-link-hover,
header.scrolled #langBtn,
header.scrolled .nav-info-text {
    color: #374151; /* text-gray-700 */
}

header.scrolled .nav-link-hover:hover,
header.scrolled #langBtn:hover {
    color: #CE2C56; /* hover color */
}

header.scrolled #langBtn {
    border-color: #d1d5db; /* border-gray-300 */
}

header.scrolled .mobile-menu-btn {
    color: #374151;
}

/* Hide mobile menu on desktop */
@media (min-width: 768px) {
    #mobileMenu {
        display: none !important;
    }
}

/* Mobile Menu active state - ensure header is readable when menu is open */
header.mobile-menu-open {
    background-color: white;
}
header.mobile-menu-open .mobile-menu-btn {
    color: #374151;
}
header.mobile-menu-open .nav-link-hover,
header.mobile-menu-open #langBtn,
header.mobile-menu-open .nav-info-text {
    color: #374151;
}

/* 章节编号样式 */
.chapter-number {
    display: inline-block;
    width: 90px;
    height: 90px;
    background-image: url('../img/chapter_number_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    margin-right: 12px;
    vertical-align: middle;
    flex-shrink: 0;
}

.chapter-number span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 36px;
    font-weight: bold;
    font-style: italic;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.section-title-wrapper h2,
.section-title-wrapper h3 {
    margin-bottom: 0;
    line-height: 1;
}

@media (max-width: 768px) {
    .chapter-number {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }
    
    .chapter-number span {
        font-size: 26px;
    }
}

/* 替换所有橙色为品牌色 */
.text-brand-red { color: #CE2C56 !important; }
.text-orange-300 { color: #E06A8E !important; }
.text-orange-400 { color: #D94C7A !important; }
.text-orange-500 { color: #CE2C56 !important; }
.text-orange-600 { color: #B01E43 !important; }
.bg-orange-100 { background-color: #F9E8EC !important; }
.bg-orange-500 { background-color: #CE2C56 !important; }
.bg-orange-600 { background-color: #B01E43 !important; }
.hover\:text-orange-500:hover { color: #CE2C56 !important; }
.hover\:bg-orange-600:hover { background-color: #B01E43 !important; }
.hover\:border-orange-500:hover { border-color: #CE2C56 !important; }
.border-orange-500 { border-color: #CE2C56 !important; }

/* 导航链接样式 - 统一所有页面 */
.nav-link-hover {
    position: relative !important;
    display: inline-block !important;
    padding-bottom: 4px !important;
    font-size: 12px !important; /* 导航文字大小 */
    font-weight: 500 !important;
    line-height: 1.75rem !important; /* 28px */
}

.nav-link-hover::after {
    content: '' !important;
    position: absolute !important;
    width: 100% !important;
    height: 2px !important;
    bottom: 0 !important;
    left: 0 !important;
    background: linear-gradient(90deg, #CE2C56 0%, #E06A8E 100%) !important;
    transform: scaleX(0) !important;
    transform-origin: left !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    border-radius: 1px !important;
}

.nav-link-hover:hover::after {
    transform: scaleX(1) !important;
}

/* 导航当前页面激活状态 */
.nav-link-active::after {
    transform: scaleX(1) !important;
}

/* 服务图标背景 */
.service-icon {
    background: linear-gradient(135deg, #CE2C56 0%, #E06A8E 100%);
}

/* 统计数字颜色 */
.stat-number {
    color: #FFFFFF;
}

/* 项目标签背景 */
.project-badge {
    background-color: #CE2C56;
}

/* 页脚链接Hover */
.footer a:hover {
    color: #CE2C56;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #CE2C56;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #B01E43;
}

/* 合作伙伴轮播样式 - 2-3-2 菱形布局 */
.partner-carousel-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 0; /* 减小上下 padding */
    overflow-x: hidden;
    overflow-y: visible; 
}

.partner-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.partner-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0; /* 移除 padding */
}

/* 菱形容器 */
.partner-diamond {
    width: 110px;
    height: 110px;
    transform: rotate(45deg);
    overflow: hidden;
    border: 2px solid #eee;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    background: white;
    transition: all 0.3s ease;
    margin: 20px 65px; /* 上下间距减小，左右间距保持大 */
    position: relative;
    z-index: 10;
}

.partner-diamond:hover {
    border-color: #CE2C56;
    transform: rotate(45deg) scale(1.05);
    box-shadow: 0 10px 25px rgba(206, 44, 86, 0.15);
    z-index: 20;
}

/* 内部图片容器 (反向旋转) */
.partner-diamond-inner {
    width: 100%;
    height: 100%;
    transform: rotate(-45deg) scale(1.42); /* scale(sqrt(2)) to fill */
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.partner-logo {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
    transition: filter 0.3s ease;
}

/* 轮播导航按钮 */
.partner-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 30;
    color: #666;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.partner-nav-btn:hover {
    background: #CE2C56;
    color: white;
    border-color: #CE2C56;
}

.partner-nav-prev {
    left: -80px; /* 移到外部 */
}

.partner-nav-next {
    right: -80px; /* 移到外部 */
}

/* 响应式调整 */
@media (max-width: 1280px) {
    .partner-nav-prev { left: 10px; }
    .partner-nav-next { right: 10px; }
}

@media (max-width: 768px) {
    .partner-carousel-container {
        padding: 40px 0;
    }
    
    .partner-diamond {
        width: 80px;
        height: 80px;
        margin: 15px 40px; /* 平板端调整间距 */
        border-radius: 10px;
    }
    
    .grid-cols-5 {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .partner-diamond {
        width: 55px;
        height: 55px;
        margin: 10px 15px; /* 移动端调整间距 */
        border-radius: 8px;
    }
}

/* 业务范围 - 圆形布局动画 */
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin-slow-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

.animate-spin-slow {
    animation: spin-slow 20s linear infinite;
}

.animate-spin-slow-reverse {
    animation: spin-slow-reverse 20s linear infinite;
}

/* 业务范围虚线连接效果 */
.bs-line-connector {
    stroke-dasharray: 5, 5;
    animation: dash 30s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -1000;
    }
}

/* Logo 呼吸动画 */
@keyframes breathe {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.03);
    }
}

.animate-breathe {
    animation: breathe 3s ease-in-out infinite;
}

/* Logo hover breathe animation */
@keyframes logo-breathe-anim {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1);
    }
    50% {
        opacity: 0.35;
        transform: scale(1.05);
    }
}

.logo-breathe {
    opacity: 0;
    transform: scale(1);
    transition: opacity 0.3s ease;
}

.group:hover .logo-breathe {
    animation: logo-breathe-anim 2s ease-in-out infinite;
}

/* ========================================
   代理网络 Section 样式 (使用图片地图)
   ======================================== */

/* 区域切换标签 - 水平排列带分隔符 */
.network-tab {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 1px;
}

.network-tab:hover {
    color: #f59e0b;
}

.network-tab.active {
    color: #f59e0b;
    font-weight: 500;
}

.network-tab-separator {
    color: rgba(255, 255, 255, 0.25);
    font-size: 14px;
    padding: 0 6px;
    user-select: none;
}

/* 地图容器 */
.network-map-wrapper {
    position: relative;
    width: 100%;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 地图图片样式 */
.network-map-img {
    position: absolute;
    max-width: 100%;
    max-height: 450px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.network-map-img.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* 城市标记点 */
.network-city-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fbbf24;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 0 20px rgba(245, 158, 11, 0.8), 0 0 40px rgba(245, 158, 11, 0.4);
    animation: city-marker-pulse 1.8s ease-in-out infinite, city-marker-fadein 0.5s ease forwards;
    z-index: 10;
    transition: all 0.2s ease;
    opacity: 0;
}

/* 外圈光环效果 */
.network-city-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    border: 2px solid rgba(245, 158, 11, 0.6);
    animation: city-marker-ring 1.8s ease-out infinite;
}

.network-city-marker:hover,
.network-city-marker.hover-highlight {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.4) !important;
    background: #fbbf24 !important;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.4), 0 0 25px rgba(245, 158, 11, 0.8) !important;
}

@keyframes city-marker-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.4), 0 0 20px rgba(245, 158, 11, 0.8), 0 0 40px rgba(245, 158, 11, 0.4);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2), 0 0 35px rgba(245, 158, 11, 0.6), 0 0 60px rgba(245, 158, 11, 0.3);
    }
}

@keyframes city-marker-ring {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
        border-width: 2px;
    }
    100% {
        width: 300%;
        height: 300%;
        opacity: 0;
        border-width: 1px;
    }
}

@keyframes city-marker-fadein {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Tooltip */
.network-tooltip {
    position: fixed;
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(245, 158, 11, 0.3);
    max-width: 250px;
    backdrop-filter: blur(8px);
}

.network-tooltip .tooltip-country {
    font-weight: 600;
    color: #f59e0b;
    margin-bottom: 0;
    font-size: 14px;
}

.network-tooltip .tooltip-cities {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* 响应式 */
@media (max-width: 768px) {
    .network-tab {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .network-tab-separator {
        padding: 0 4px;
    }
    
    .network-map-wrapper {
        min-height: 300px;
    }
    
    .network-map-img {
        max-height: 300px;
    }
    
    .network-city-marker {
        width: 10px;
        height: 10px;
    }
}

@media (max-width: 480px) {
    .network-tab {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .network-map-wrapper {
        min-height: 220px;
    }
    
    .network-map-img {
        max-height: 220px;
    }
    
    .network-city-marker {
        width: 8px;
        height: 8px;
    }
}

/* 城市标注区域样式 */
#networkCountriesLabel {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.3s;
}

#networkCountries {
    gap: 8px;
}

/* 城市标签样式 */
.city-tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.city-tag:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
    color: #f59e0b;
    transform: translateY(-2px);
}

.city-tag.active {
    background: rgba(245, 158, 11, 0.3);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

/* 标记点强发光效果（备用） */
.network-city-marker.active-highlight {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.8) !important;
    background: #fff !important;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.4), 0 0 50px rgba(245, 158, 11, 1), 0 0 80px rgba(245, 158, 11, 0.8) !important;
    animation: marker-glow 0.8s ease-in-out infinite !important;
    z-index: 50 !important;
}

@keyframes marker-glow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1.8);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.4), 0 0 50px rgba(245, 158, 11, 1), 0 0 80px rgba(245, 158, 11, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(2.2);
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0.2), 0 0 70px rgba(245, 158, 11, 1), 0 0 100px rgba(245, 158, 11, 0.9);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式城市标签 */
@media (max-width: 768px) {
    .city-tag {
        padding: 4px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .city-tag {
        padding: 3px 8px;
        font-size: 11px;
    }
}

/* 编辑模式样式 */
#mapMarkersOverlay.edit-mode {
    cursor: crosshair;
}

.network-city-marker.edit-mode {
    cursor: grab;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3), 0 0 15px rgba(34, 197, 94, 0.6);
}

.network-city-marker.edit-mode:hover {
    background: #4ade80;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.4), 0 0 25px rgba(34, 197, 94, 0.8);
    transform: translate(-50%, -50%) scale(1.3);
}

.network-city-marker.dragging {
    cursor: grabbing !important;
    background: #ef4444 !important;
    box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.4), 0 0 30px rgba(239, 68, 68, 0.8) !important;
    transform: translate(-50%, -50%) scale(1.5) !important;
    z-index: 100 !important;
    animation: none !important;
}

/* ========================================
   客户案例内页样式优化
   ======================================== */

/* 案例内页 - 内容区域样式优化 */
.prose {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.prose p {
    font-weight: 400;
    color: #4b5563; /* gray-600 */
    line-height: 1.8;
    font-size: 15px;
}

.prose h3 {
    font-weight: 600; /* 从 bold 改为 semibold */
    color: #374151; /* gray-700，比 gray-800 稍浅 */
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.prose ul {
    font-size: 15px;
}

.prose li {
    font-weight: 400;
    color: #4b5563;
    line-height: 1.75;
}

.prose li strong {
    font-weight: 500; /* 从 bold 改为 medium */
    color: #374151;
}

/* 案例页面主标题 */
.prose-lg {
    font-size: 15px;
}

/* 案例页面章节标题 */
[data-i18n="caseStudies.common.challenge"],
[data-i18n="caseStudies.common.solution"],
[data-i18n="caseStudies.common.value"],
[data-i18n="caseStudies.common.review"] {
    font-weight: 600 !important;
    color: #1f2937 !important; /* gray-800 */
}

/* 客户评价区块样式 */
.bg-gray-50 .prose p {
    font-style: italic;
    color: #6b7280;
}

/* ==================== 关于我们页面样式 ==================== */
.about-section-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.05em;
}

.about-section-title span {
    font-size: 1.5em;
    line-height: 1;
}

/* ==================== 案例页面 Hero 样式 ==================== */
.case-hero {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.case-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.case-hero:hover .case-hero-bg {
    transform: scale(1.02);
}

.case-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
}

/* 标题动画 - 从下往上淡入 */
.case-hero-title {
    position: relative;
    z-index: 10;
    text-align: right;
    width: 100%;
    max-width: 48rem; /* 和内容区 max-w-3xl 一致 */
    padding: 0 1rem;
}

.case-hero-title .title-en {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px;
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
    animation: slideUpFade 0.8s ease-out forwards;
    opacity: 0;
    margin-top: 5px;
    margin-right: -5px;
}

.case-hero-title .title-cn {
    animation: slideUpFade 0.8s ease-out 0.2s forwards;
    opacity: 0;
    margin-top: -5px;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 首字母 C 的红色背景图 - 通用样式 */
.hero-big-letter,
.case-letter-c {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 75px;
    margin-right: -12px;
}

.hero-big-letter::before,
.case-letter-c::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../img/text_red_bg.png') no-repeat center center;
    background-size: contain;
    z-index: -1;
}

.hero-big-letter span,
.case-letter-c span {
    font-size: 3rem;
    font-weight: 700;
    font-style: italic;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: relative;
    top: 0px;
    left: 15px;
    /* 使用Arial Black确保跨平台一致性 */
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
}

@media (min-width: 768px) {
    .hero-big-letter,
    .case-letter-c {
        width: 95px;
        height: 85px;
        margin-right: -14px;
    }
    
    .hero-big-letter span,
    .case-letter-c span {
        font-size: 3.5rem;
    }
}

/* Contact section - connection lines animation */
.contact-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: contact-line-draw 3s ease-in-out infinite;
}

@keyframes contact-line-draw {
    0% {
        stroke-dashoffset: 200;
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}
