/**
 * 自定义样式
 * 包含所有页面共享的 CSS 样式
 */

/* ============================================
   公共导航栏样式(由 header.js 注入,所有页面共享)
   ============================================ */
html { scroll-behavior: smooth; }

.gradient-bg { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.glass-header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); }

/* ===== Dropdown Menu 基础样式 ===== */
.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* ===== Mega Menu(产品 & 解决方案) ===== */
.dropdown-mega { position: static; }

.dropdown-mega .dropdown-menu {
    position: fixed;
    left: 0;
    width: 100vw;
    padding: 2.5rem 2rem;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    z-index: 999;
    background: white;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 产品菜单使用 2 列 */
.dropdown-mega:nth-child(2) .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 800px;
    gap: 3rem;
}

.mega-menu-column h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #10B981;
}

.mega-menu-column a {
    display: block;
    padding: 0.5rem 0;
    color: #6B7280;
    text-decoration: none;
    line-height: 1.6;
    position: relative;
    transition: all 0.2s ease;
}

.mega-menu-column a::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    width: 0;
    height: 2px;
    background: #10B981;
    transform: translateY(-50%);
    transition: width 0.2s ease;
}

.mega-menu-column a:hover {
    color: #10B981;
    padding-left: 0.75rem;
}

.mega-menu-column a:hover::before { width: 6px; }

/* ===== 常规 Dropdown hover 触发 ===== */
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.dropdown {
    padding-bottom: 10px;
    margin-bottom: -10px;
}

/* ===== 搜索弹窗 display 控制 ===== */
.search-modal { display: none !important; }
.search-modal.active { display: flex !important; }

/* ===== 移动端下拉切换 ===== */
.mobile-dropdown-toggle {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.mobile-dropdown-toggle.active .chevron-icon { transform: rotate(180deg); }
.mobile-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}
.mobile-dropdown-content.show { max-height: 1000px; }

/* ===== 导航项样式 ===== */
.header-nav { position: relative; }

.dropdown-menu a {
    position: relative;
    transition: all 0.2s ease;
    overflow: hidden;
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #10B981, #059669);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.dropdown-menu a:hover::before { transform: scaleY(1); }

.dropdown-menu a:hover {
    padding-left: 1.25rem;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
}

#header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.98);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .mega-menu-grid,
    .dropdown-mega:nth-child(2) .mega-menu-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .mega-menu-grid,
    .dropdown-mega:nth-child(2) .mega-menu-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .dropdown-mega .dropdown-menu { padding: 1.5rem; }
}


/* ============================================
   动画效果
   ============================================ */

/* 淡入上移动画 */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fade-up 0.6s ease-out forwards;
}

/* 淡入动画 */
@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fade-in 0.4s ease-out forwards;
}

/* 缩放淡入动画 */
@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-scale-in {
    animation: scale-in 0.3s ease-out forwards;
}

/* 脉冲动画 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* 加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* ============================================
   卡片样式
   ============================================ */

.resource-card {
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
}

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

.index-product-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.index-product-btn:hover {
    background-color: currentColor;
    color: white !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-2px);
}

/* ============================================
   时间轴样式
   ============================================ */

.timeline-item {
    position: relative;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #10b981, #06b6d4);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #10b981;
}

/* ============================================
   模态框样式
   ============================================ */

/* 视频模态框 */
#video-modal {
    backdrop-filter: blur(4px);
}

/* 下载模态框 */
#download-modal {
    backdrop-filter: blur(4px);
}

#download-modal .modal-content {
    animation: scale-in 0.3s ease-out;
}

/* 搜索遮罩 */
#search-overlay {
    backdrop-filter: blur(8px);
}

/* ============================================
   按钮样式
   ============================================ */

.btn-primary {
    @apply px-6 py-3 rounded-xl font-medium;
    @apply focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2;
}

.btn-secondary {
    @apply bg-white text-emerald-600 px-6 py-3 rounded-xl font-medium border-2 border-emerald-600;
    @apply hover:bg-emerald-50 transition-colors;
    @apply focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2;
}

/* ============================================
   表单样式
   ============================================ */

.form-input {
    @apply w-full px-4 py-2.5 border border-slate-200 rounded-xl;
    @apply focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500;
    @apply outline-none transition-all;
}

.form-input::placeholder {
    @apply text-slate-400;
}

/* ============================================
   标签页样式
   ============================================ */

.tab-btn {
    @apply px-6 py-3 rounded-xl font-medium transition-all;
}

.tab-btn.active {
    @apply bg-emerald-600 text-white;
}

.tab-btn:not(.active) {
    @apply bg-slate-100 text-slate-600 hover:bg-slate-200;
}

/* ============================================
   滚动条样式
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   工具类
   ============================================ */

/* 文字截断 */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 渐变文字 */
.text-gradient {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   响应式工具
   ============================================ */

/* 移动端优化 */
@media (max-width: 640px) {
    .mobile-full {
        width: 100%;
        margin-left: 0;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-after: always;
    }
}
