/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

/* 导航栏滚动效果 */
#navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
}

#navbar.dark.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
}

/* 移动端菜单动画 */
#mobile-menu {
    transition: all 0.3s ease-in-out;
    transform-origin: top center;
    opacity: 0;
    transform: translateY(-20px);
    visibility: hidden;
}

#mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* 粒子背景容器 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -10;
}

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

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

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

/* 数字计数器动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter {
    animation: countUp 1s ease-out;
}

/* 渐变文字 */
.text-gradient {
    background-size: 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
}

/* 跑马灯动画效果 */
@keyframes marqueeAnimation {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-text {
    display: inline-block;
    animation: marqueeAnimation 10s linear infinite;
    white-space: nowrap;
}

.marquee-text span {
    margin-right: 8rem;
}

/* 友情链接样式优化 */
.footer-links {
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.footer-links::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #fff;
    transition: width 0.3s ease;
}

.footer-links:hover::after {
    width: 100%;
}

.footer-links:hover {
    color: #fff;
    transform: translateX(5px);
}

/* 响应式布局调整 */
@media (max-width: 1024px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* 图片加载动画 */
img {
    transition: opacity 0.5s ease;
}

img.loading {
    opacity: 0;
}

/* 回到顶部按钮动画 */
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* 动画延迟类 */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* 入场动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 阴影效果 */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 文本截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 文本换行 */
.text-break {
    word-break: break-word;
}

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

/* Flex 工具类 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 宽高比 */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%;
}

.aspect-h-9 {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* 焦点样式 */
:focus {
    outline: 2px solid #0E84FF;
    outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
    background-color: rgba(14, 132, 255, 0.2);
    color: #0E84FF;
}

::-moz-selection {
    background-color: rgba(14, 132, 255, 0.2);
    color: #0E84FF;
}

/* 滚动条样式 */
::-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;
}

/* 暗色模式滚动条 */
.dark ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4a4a4a;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

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

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

/* 心跳动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 抖动动画 */
@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

/* 响应式网格调整 */
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* 打印样式 */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
    
    pre, blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr, img {
        page-break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
    }
    
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
    
    h2, h3 {
        page-break-after: avoid;
    }
}