/* 自定义动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

.animate-fade-in-delay {
    animation: fadeInDelay 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.animate-fade-in-delay-2 {
    animation: fadeInDelay2 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

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

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

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 自定义表单元素样式 */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 按钮悬停效果增强 */
button,
a.button {
    transition: all 0.3s ease;
}

button:hover,
a.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* 导航链接下划线动画 */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #3b82f6;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* 移动端菜单动画 */
#mobile-menu {
    transition: all 0.3s ease;
}

/* 下拉菜单动画 */
.dropdown-menu {
    transition: all 0.3s ease;
}

/* 自定义过渡效果 */
.transition-all-300 {
    transition: all 0.3s ease;
}

/* 自定义阴影效果 */
.shadow-custom {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 自定义边框圆角 */
.rounded-custom {
    border-radius: 12px;
}

/* 响应式字体大小 */
@media (max-width: 767px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* 图片加载动画 */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: imgLoading 1.5s infinite;
}

@keyframes imgLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 自定义工具类 */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bg-gradient-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.bg-gradient-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.bg-gradient-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bg-gradient-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* 自定义列表样式 */
.list-custom {
    list-style: none;
    padding: 0;
}

.list-custom li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
}

.list-custom li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* 自定义分隔线 */
.divider {
    height: 4px;
    width: 60px;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    margin: 24px auto;
}

/* 自定义引用样式 */
blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

/* 自定义代码块样式 */
pre {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

code {
    background-color: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

/* 自定义表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table th,
table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

table tr:hover {
    background-color: #f8fafc;
}

/* 自定义标签样式 */
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
}

.tag-primary {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.tag-secondary {
    background-color: #e2e8f0;
    color: #475569;
}

.tag-success {
    background-color: #d1fae5;
    color: #065f46;
}

.tag-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.tag-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

/* 自定义进度条样式 */
.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 自定义计数器动画 */
.counter {
    font-size: 3rem;
    font-weight: bold;
    color: #3b82f6;
}

/* 自定义悬停效果 */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 自定义过渡效果 */
.transition-custom {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 自定义焦点样式 */
.focus-custom:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* 自定义选择文本样式 */
::selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: #1e293b;
}

::-moz-selection {
    background-color: rgba(59, 130, 246, 0.2);
    color: #1e293b;
}

/* 自定义打印样式 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    nav,
    footer,
    .no-print {
        display: none;
    }
    
    main {
        width: 100%;
        max-width: 100%;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}