/**
 * 自动链接标题样式
 */

/* 基础链接样式 */
a.auto-link-title {
    position: relative;
    text-decoration: none;
    border-bottom: 1px dashed #999;
    color: #0066cc;
    transition: all 0.3s ease;
}

a.auto-link-title:hover {
    border-bottom-color: #0066cc;
    color: #0052a3;
}

/* 加载中状态 */
a.auto-link-title.title-loading {
    color: #999;
    cursor: wait;
}

a.auto-link-title.title-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    border: 2px solid #999;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* 加载成功状态 */
a.auto-link-title.title-loaded {
    border-bottom-style: solid;
    font-weight: 500;
}

/* 加载失败状态 */
a.auto-link-title.title-failed {
    opacity: 0.7;
}

/* 旋转动画 */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    a.auto-link-title {
        color: #4da6ff;
        border-bottom-color: #666;
    }
    
    a.auto-link-title:hover {
        border-bottom-color: #4da6ff;
        color: #66b3ff;
    }
    
    a.auto-link-title.title-loading {
        color: #aaa;
    }
    
    a.auto-link-title.title-loading::after {
        border-color: #aaa;
        border-top-color: transparent;
    }
}

/* 响应式优化 */
@media screen and (max-width: 768px) {
    a.auto-link-title.title-loading::after {
        width: 10px;
        height: 10px;
        margin-left: 3px;
    }
}

/* 打印样式 */
@media print {
    a.auto-link-title {
        border-bottom: none;
        color: #000;
        text-decoration: underline;
    }
    
    a.auto-link-title::after {
        display: none !important;
    }
}
