/**
 * GSAP 动画样式 - 白色背景、黑色文字、红色线条
 */

/* 基础动画样式 */
.animated {
    will-change: transform, opacity;
}

/* 返回顶部按钮 */
#rocket {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-color: #c00 !important;
    color: #fff !important;
    box-shadow: 0 0 20px rgba(204, 0, 0, 0.3) !important;
}

#rocket.rocket-show {
    opacity: 1;
    transform: translateY(0);
}

#rocket:hover {
    background-color: #f00 !important;
    box-shadow: 0 0 30px rgba(204, 0, 0, 0.5) !important;
}

/* 文章卡片悬停效果 */
.post {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(204, 0, 0, 0.2) !important;
    border-color: #c00 !important;
}

/* 标题悬停效果 */
.post-title a {
    transition: color 0.3s ease !important;
    color: #000 !important;
}

.post-title a:hover {
    color: #c00 !important;
}

/* 目录样式 */
.toc-article {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.toc-article a {
    transition: color 0.3s ease, padding-left 0.3s ease;
    color: #000 !important;
}

.toc-article a:hover {
    color: #c00 !important;
    padding-left: 5px;
}

/* 图片懒加载 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[src] {
    opacity: 1;
}

/* 侧边栏部件 */
.sidebar-widget {
    transition: transform 0.3s ease, opacity 0.3s ease, border-color 0.3s ease;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.sidebar-widget:hover {
    transform: translateX(-5px);
    border-color: #c00 !important;
}

/* 标签云动画 */
.tag-cloud a {
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    display: inline-block;
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
}

.tag-cloud a:hover {
    transform: scale(1.1);
    background-color: #c00 !important;
    color: #fff !important;
    border-color: #c00 !important;
}

/* 滚动指示器 */
.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #c00;
    transform-origin: left;
    transform: scaleX(0);
    z-index: 1000;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(204, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #c00;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 文字打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: .15em solid #c00;
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: .15em;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret .75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #c00; }
}

/* 卡片翻转效果 */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.flip-card-back {
    transform: rotateY(180deg);
    background-color: #c00 !important;
    color: #fff !important;
}

/* 响应式动画 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 移动端优化 */
@media (max-width: 768px) {
    .post {
        transform: none !important;
    }
    
    .post:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* 按钮样式 */
.btn, button {
    background-color: #c00 !important;
    color: #fff !important;
    border: 1px solid #c00 !important;
    transition: background-color 0.3s ease, border-color 0.3s ease !important;
}

.btn:hover, button:hover {
    background-color: #f00 !important;
    border-color: #f00 !important;
}

/* 链接样式 */
a {
    color: #c00 !important;
    transition: color 0.3s ease !important;
}

a:hover {
    color: #f00 !important;
}

/* 表格样式 */
table {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

th {
    background-color: #c00 !important;
    color: #fff !important;
}

td {
    color: #000 !important;
    border: 1px solid #ddd !important;
}

tr:hover {
    background-color: #f9f9f9 !important;
}

/* 代码块样式 */
pre, code {
    background-color: #f5f5f5 !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
}

/* 引用块样式 */
blockquote {
    background-color: #f9f9f9 !important;
    border-left: 4px solid #c00 !important;
    color: #333 !important;
}

/* 分页样式 */
.paginator a {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
    transition: background-color 0.3s ease, border-color 0.3s ease !important;
}

.paginator a:hover {
    background-color: #c00 !important;
    border-color: #c00 !important;
    color: #fff !important;
}

.paginator .current {
    background-color: #c00 !important;
    color: #fff !important;
    border-color: #c00 !important;
}

/* 评论区样式 */
#comments {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

#comments h3 {
    color: #c00 !important;
    border-bottom: 2px solid #c00 !important;
}

/* 评论输入框样式 */
#comment-form input, #comment-form textarea {
    background-color: #fff !important;
    color: #000 !important;
    border: 1px solid #ddd !important;
}

#comment-form input:focus, #comment-form textarea:focus {
    border-color: #c00 !important;
}

/* 搜索结果样式 */
.search-results {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.search-results h3 {
    color: #c00 !important;
}

/* 归档页面样式 */
.archives {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.archives h2 {
    color: #c00 !important;
    border-bottom: 2px solid #c00 !important;
}

/* 标签页面样式 */
.tags {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.tags h2 {
    color: #c00 !important;
    border-bottom: 2px solid #c00 !important;
}

/* 分类页面样式 */
.categories {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.categories h2 {
    color: #c00 !important;
    border-bottom: 2px solid #c00 !important;
}

/* 关于页面样式 */
.about {
    background-color: #fff !important;
    border: 1px solid #ddd !important;
}

.about h1 {
    color: #c00 !important;
    border-bottom: 2px solid #c00 !important;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px !important;
    height: 10px !important;
}

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

::-webkit-scrollbar-thumb {
    background: #c00 !important;
    border-radius: 5px !important;
}

::-webkit-scrollbar-thumb:hover {
    background: #f00 !important;
}

/* 选中文本颜色 */
::selection {
    background-color: #c00 !important;
    color: #fff !important;
}

::-moz-selection {
    background-color: #c00 !important;
    color: #fff !important;
}
