/* 自定义样式文件 */

/* 全局样式 */
html { scroll-behavior: smooth; }

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 导航栏滚动效果 */
header.scrolled,
nav.shadow-md {
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.04);
    background-color: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 按钮动画效果 */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 卡片悬停效果优化 */
.card-hover {
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(22, 93, 255, 0.05), rgba(54, 203, 203, 0.05));
    z-index: -1;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.card-hover:hover::before {
    opacity: 1;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 链接样式增强 */
a {
    transition: all 0.3s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.pulse {
    animation: pulse 2s infinite;
}

/* 图片加载动画 */
.img-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 表单输入框聚焦效果 */
input:focus,
textarea:focus {
    transition: all 0.3s ease;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 文本选择样式 */
::selection {
    background-color: rgba(22, 93, 255, 0.2);
    color: #165DFF;
}

::-moz-selection {
    background-color: rgba(22, 93, 255, 0.2);
    color: #165DFF;
}

/* 背景渐变增强 */
.bg-gradient-primary {
    background: linear-gradient(135deg, #165DFF 0%, #0A3CAD 100%);
}

/* 阴影增强 */
.shadow-soft {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

/* 圆角增强 */
.rounded-soft {
    border-radius: 12px;
}

.rounded-xl {
    border-radius: 16px;
}

/* 案例筛选按钮样式 */
.case-filter-btn {
    transition: all 0.3s ease;
}

.case-filter-btn.active {
    border-color: transparent;
    background-color: #165DFF;
    color: white;
}
.text-top {
    text-align: left;
    /* 段落缩进2个汉字 */
    text-indent: 2em;
}

/* 解决激活状态下按钮悬停时字体颜色不清楚的问题 */
.case-filter-btn.active:hover {
    color: rgb(159, 65, 65) !important;
    opacity: 0.95;
}

/* 打印样式 */
@media print {
    header,
    footer,
    .no-print {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .card-hover {
        border: 2px solid currentColor;
    }
    
    button,
    a {
        border: 2px solid transparent;
    }
    
    button:focus,
    a:focus {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }
}

/* 减少动画偏好设置支持 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}