/* ============================================
   华君智算全站公共样式 — 大气感视觉增强版
   ============================================ */

/* ===== 1. 设计系统变量（完整色彩/阴影/圆角/间距/过渡体系） ===== */
:root {
    /* --- 主色系 --- */
    --primary:          #165DFF;
    --primary-light:    #4080FF;
    --primary-lighter:  #93B5F6;
    --primary-dark:     #0A1F44;
    --primary-darkest:  #06142D;

    /* --- 辅助色 --- */
    --secondary:        #0E2B5C;
    --accent:           #4080FF;
    --accent-green:     #10B981;
    --accent-orange:    #F59E0B;

    /* --- 功能色 --- */
    --success:          #10B981;
    --success-light:    #D1FAE5;
    --warning:          #F59E0B;
    --warning-light:    #FEF3C7;
    --danger:           #EF4444;
    --danger-light:     #FEE2E2;
    --info:             #3B82F6;
    --info-light:       #DBEAFE;

    /* --- 灰度色阶（9级） --- */
    --gray-50:          #F8FAFD;
    --gray-100:         #F1F5F9;
    --gray-200:         #E2E8F0;
    --gray-300:         #CBD5E1;
    --gray-400:         #94A3B8;
    --gray-500:         #64748B;
    --gray-600:         #475569;
    --gray-700:         #334155;
    --gray-800:         #1E293B;
    --gray-900:         #0F172A;

    /* --- 文字色 --- */
    --text-primary:      #1E293B;
    --text-secondary:    #475569;
    --text-tertiary:     #94A3B8;
    --text-inverse:      #FFFFFF;

    /* --- 背景色 --- */
    --bg-primary:        #FFFFFF;
    --bg-secondary:      #F8FAFD;
    --bg-tertiary:       #F1F5F9;
    --bg-dark:           #0A1F44;

    /* --- 渐变色预设 --- */
    --gradient-primary:  linear-gradient(135deg, #165DFF 0%, #0A1F44 100%);
    --gradient-hero:     linear-gradient(160deg, #0A1F44 0%, #165DFF 50%, #4080FF 100%);
    --gradient-accent:   linear-gradient(135deg, #165DFF 0%, #4080FF 100%);
    --gradient-dark:     linear-gradient(135deg, #0A1F44 0%, #06142D 100%);
    --gradient-card:     linear-gradient(135deg, rgba(22,93,255,0.05) 0%, rgba(22,93,255,0.02) 100%);

    /* --- 统一阴影系统（5级，带蓝色调） --- */
    --shadow-xs:         0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm:         0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md:         0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg:         0 16px 40px rgba(22, 93, 255, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-xl:         0 24px 56px rgba(22, 93, 255, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-2xl:        0 32px 64px rgba(22, 93, 255, 0.16), 0 12px 32px rgba(0, 0, 0, 0.1);
    --shadow-card-hover:  0 20px 48px rgba(22, 93, 255, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-button:      0 4px 14px rgba(22, 93, 255, 0.25);

    /* --- 圆角系统（7级） --- */
    --radius-xs:     4px;
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --radius-2xl:    32px;
    --radius-full:   9999px;

    /* --- 过渡动画曲线 --- */
    --transition-fast:    all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:    all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce:  all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* --- 间距系统 --- */
    --section-gap:      120px;
    --section-gap-sm:   80px;
    --content-max-width: 1280px;
}

/* ===== 2. 全局字体与基础样式（Inter + Noto Sans SC 国际化字体栈） ===== */
body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: var(--text-primary);
}

/* 页面加载淡入 */
@keyframes pageFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
body {
    animation: pageFadeIn 0.5s ease-out;
}

/* ===== 3. 自定义滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track {
    background: var(--gray-50);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb {
    background: rgba(22, 93, 255, 0.3);
    border-radius: var(--radius-full);
    transition: var(--transition-base);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== 4. 主题色工具类 ===== */
.bg-primary { background-color: var(--primary); }
.text-primary { color: var(--primary); }
.border-primary { border-color: var(--primary); }
.bg-primary\/10 { background-color: rgba(22, 93, 255, 0.1); }
.bg-primary\/5 { background-color: rgba(22, 93, 255, 0.05); }
.hover\:bg-primary\/90:hover { background-color: rgba(22, 93, 255, 0.9); }
.from-primary { --tw-gradient-from: var(--primary); }
.to-primary { --tw-gradient-to: var(--primary); }

/* ===== 5. 卡片样式系统（大气版） ===== */

/* 基础卡片阴影与悬浮 */
.shadow-card {
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    border: 1px solid var(--gray-100);
}
.shadow-card:hover {
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(22, 93, 255, 0.12);
    transform: translateY(-4px);
}

/* 大卡片（产品/案例等） */
.shadow-card-lg {
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
    border: 1px solid var(--gray-100);
}
.shadow-card-lg:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(22, 93, 255, 0.12);
    transform: translateY(-6px);
}

/* 卡片hover通用类（带顶部渐变色条） */
.card-hover {
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
}
.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.card-hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(22, 93, 255, 0.15);
}
.card-hover:hover::before {
    transform: scaleX(1);
}

/* 兼容旧卡片选择器 */
.bg-white.rounded-xl,
.shadow-sm {
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* ===== 6. 光效扫过动画（用于重要卡片和CTA按钮） ===== */
.glow-border {
    position: relative;
    overflow: hidden;
}
.glow-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 40%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.15) 60%,
        transparent 100%
    );
    transform: skewX(-15deg);
    transition: left 0.7s ease;
    z-index: 1;
    pointer-events: none;
}
.glow-border:hover::after {
    left: 120%;
}

/* ===== 7. 按钮增强 ===== */
.btn,
a[class*="bg-primary"],
a[class*="bg-white"] {
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}
a[class*="bg-primary"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-button);
}
a[class*="bg-white"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* CTA大按钮特殊样式 */
.btn-hero {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
}
.btn-hero:hover i {
    transform: translateX(4px);
}
.btn-hero i {
    transition: transform 0.3s ease;
}

/* ===== 8. Hero Banner 动画关键帧 ===== */
@keyframes pulse-slow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}
@keyframes pulse-slower {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}
@keyframes fade-in-down {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes float-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.animate-pulse-slow { animation: pulse-slow 6s ease-in-out infinite; }
.animate-pulse-slower { animation: pulse-slower 8s ease-in-out infinite; }
.animate-fade-in-down { animation: fade-in-down 0.8s ease-out forwards; }
.animate-fade-in-up { animation: fade-in-up 0.8s ease-out forwards; opacity: 0; }
.animate-float { animation: float-up 4s ease-in-out infinite; }
.delay-200 { animation-delay: 0.2s; }
.delay-400 { animation-delay: 0.4s; }
.delay-600 { animation-delay: 0.6s; }
.delay-800 { animation-delay: 0.8s; }

/* ===== 9. 子页面Banner统一风格（深蓝渐变+网格纹理+光晕装饰） ===== */
.page-banner {
    background: linear-gradient(160deg, #0A1F44 0%, #165DFF 55%, #4080FF 100%);
    position: relative;
    overflow: hidden;
}
.page-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    transform: rotate(20deg);
    pointer-events: none;
}
/* 网格线纹理 */
.page-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

/* ===== 10. 区块标题增强 ===== */
.section-title {
    position: relative;
    padding-bottom: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    border-radius: 3px;
}

/* ===== 11. 数据数字强调 ===== */
.stat-number,
[class*="stat-number"] {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 12. 导航栏增强 ===== */
.nav-shadow {
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

/* 导航高亮 + 下划线滑入效果 */
header nav a.active,
#mobileMenu a.active {
    color: var(--primary) !important;
    font-weight: 600;
    position: relative;
}
header nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #4080FF);
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(22, 93, 255, 0.3);
}
#mobileMenu a.active::after {
    display: none;
}

/* 导航链接 hover 下划线 */
header nav a:not(.active):hover {
    color: var(--primary) !important;
}
header nav a:not(.active):hover::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 25%;
    width: 50%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===== 13. 滚动渐现动画（stagger版本） ===== */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.9, 0.3, 1),
                transform 0.7s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 14. 面包屑导航 ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
}
.breadcrumb a {
    color: rgba(255,255,255,0.5);
    transition: var(--transition-fast);
}
.breadcrumb a:hover {
    color: white;
}
.breadcrumb .separator {
    opacity: 0.4;
}
.breadcrumb .current {
    color: rgba(255,255,255,0.75);
}

/* ===== 15. 锚点偏移 ===== */
.scroll-mt-header {
    scroll-margin-top: 100px;
}
@media (max-width: 768px) {
    .scroll-mt-header { scroll-margin-top: 80px; }
}

/* ===== 16. 表格增强 ===== */
table {
    border-collapse: separate;
    border-spacing: 0;
}
th {
    font-weight: 600;
    letter-spacing: 0.02em;
}
td, th {
    border-bottom: 1px solid var(--gray-200);
}

/* ===== 17. 表单元素增强 ===== */
input, textarea, select {
    transition: var(--transition-base);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.15);
}

/* ===== 18. 页脚链接悬停 ===== */
footer a:hover {
    color: var(--primary) !important;
}

/* ===== 19. 返回顶部按钮（弹性缩放版） ===== */
#backToTop {
    background: var(--primary);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-bounce);
}
#backToTop:hover {
    transform: scale(1.1) translateY(-4px);
    background: var(--primary-dark);
}

/* ===== 20. 内容区容器约束 ===== */
.content-container {
    max-width: var(--content-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}
.content-narrow {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ===== 21. 大屏适配 ===== */
@media (min-width: 1536px) {
    .content-container { max-width: 1320px; }
}
@media (min-width: 1920px) {
    :root { --content-max-width: 1400px; }
    body { font-size: 17px; }
}

/* ===== 22. 移动端优化 ===== */
@media (max-width: 640px) {
    .card-hover:hover { transform: translateY(-3px); }
    .shadow-card:hover { transform: translateY(-2px); }
    .shadow-card-lg:hover { transform: translateY(-3px); }
    .btn-hero {
        padding: 0.875rem 2rem;
    }
}

/* ===== 23. 图标通用hover效果 ===== */
.icon-hover {
    transition: transform 0.3s ease;
}
.icon-hover:hover {
    transform: scale(1.1);
}

/* ===== 24. 装饰性渐变线条 ===== */
.accent-line {
    width: 80px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
}

/* ===== 25. 文本截断（line-clamp） ===== */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 26. 打印优化 ===== */
@media print {
    .page-banner { background: #0A1F44 !important; color: black; }
    .page-banner * { color: black !important; }
    header, footer, #backToTop, .btn-hero { display: none !important; }
    body { font-size: 12pt; color: black; }
    a { text-decoration: underline; }
    .shadow-card, .shadow-card-lg, .card-hover { box-shadow: none; border: 1px solid #ddd; }
}

/* ===== 27. 无障碍增强 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
