/* 博客自定义样式 */

/* 滚动条样式 */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgb(161 161 170);
    border-radius: 3px;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgb(82 82 91);
}

::-webkit-scrollbar-thumb:hover {
    background: rgb(113 113 122);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgb(113 113 122);
}

/* 动画效果 */
.animate-in {
    animation: fadeInUp 0.5s ease-out;
}

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

/* 文本截断 */
.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;
}

/* 选择文本样式 */
::selection {
    background-color: rgb(212 212 216);
}

.dark ::selection {
    background-color: rgb(39 39 42);
}

/* 焦点样式 */
.focus-ring:focus {
    outline: 2px solid rgb(59 130 246);
    outline-offset: 2px;
}

.dark .focus-ring:focus {
    outline-color: rgb(147 197 253);
}

/* 按钮悬停效果 */
.btn-hover-scale:hover {
    transform: scale(1.02);
}

.btn-hover-scale:active {
    transform: scale(0.98);
}

/* 卡片悬停效果 */
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dark .card-hover:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* 代码块样式增强 */
.prose pre {
    position: relative;
    overflow-x: auto;
    max-width: 100%;
}

.prose pre code {
    display: block;
    white-space: pre;
}

.prose pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.1), transparent);
}

.dark .prose pre::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* 行内代码自动换行 */
.prose :not(pre) > code {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 长URL和链接自动换行 */
.prose a {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 链接样式 */
.prose a {
    color: rgb(59 130 246);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.prose a:hover {
    border-bottom-color: rgb(59 130 246);
}

.dark .prose a {
    color: rgb(147 197 253);
}

.dark .prose a:hover {
    border-bottom-color: rgb(147 197 253);
}

/* 表格样式 */
.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
}

.prose th,
.prose td {
    border: 1px solid rgb(212 212 216);
    padding: 0.75rem;
    text-align: left;
}

.dark .prose th,
.dark .prose td {
    border-color: rgb(63 63 70);
}

.prose th {
    background-color: rgb(244 244 245);
    font-weight: 600;
}

.dark .prose th {
    background-color: rgb(39 39 42);
}

/* 引用样式增强 */
.prose blockquote {
    position: relative;
    font-style: italic;
    padding-left: 2rem;
}

.prose blockquote::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -0.5rem;
    font-size: 3rem;
    color: rgb(212 212 216);
    font-family: serif;
}

.dark .prose blockquote::before {
    color: rgb(63 63 70);
}

/* 加载动画 */
.loading-dots {
    display: inline-flex;
    gap: 2px;
}

.loading-dots div {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: currentColor;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots div:nth-child(1) { animation-delay: -0.32s; }
.loading-dots div:nth-child(2) { animation-delay: -0.16s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 响应式调整 */
@media (max-width: 640px) {
    .animate-in {
        animation-duration: 0.3s;
    }
    
    .card-hover:hover {
        transform: none;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .prose {
        font-size: 12pt;
        line-height: 1.5;
    }
}