/* ==========================================
   UI组件样式
   提供额外的界面组件
========================================== */

/* 阅读进度条 */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 9999;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff7a59, #667eea);
    width: 0%;
    transition: width 0.1s ease;
}

/* 通知消息 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #ef4444;
}

.notification-info {
    background: #3b82f6;
}

.notification-warning {
    background: #f59e0b;
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 10001;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

/* 加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #ff7a59;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 文章预览悬停效果 */
.article-preview {
    position: relative;
    overflow: hidden;
}

.article-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.article-preview:hover::before {
    left: 100%;
}

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

.img-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-lazy.loaded {
    opacity: 1;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.tag-item {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.tag-item:hover {
    background: #ff7a59;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(255, 122, 89, 0.3);
}

/* 社交分享按钮 */
.social-share {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.share-btn.weibo {
    background: #e6162d;
}

.share-btn.wechat {
    background: #00c05a;
}

.share-btn.qq {
    background: #12b7f5;
}

.share-btn.copy {
    background: #6b7280;
}

/* 代码块样式 */
.code-block {
    background: #1f2937;
    color: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 20px 0;
    position: relative;
}

.code-block::before {
    content: attr(data-language);
    position: absolute;
    top: 10px;
    right: 15px;
    color: #9ca3af;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 引用块 */
.blockquote {
    border-left: 4px solid #ff7a59;
    background: #f8fafc;
    padding: 20px 25px;
    margin: 20px 0;
    font-style: italic;
    position: relative;
}

.blockquote::before {
    content: '"';
    font-size: 4rem;
    color: #ff7a59;
    position: absolute;
    top: -10px;
    left: 15px;
    opacity: 0.3;
}

.blockquote p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.blockquote-author {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, #ff7a59, #ff6b4a);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #e5654b, #e55a40);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 122, 89, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-outline {
    background: transparent;
    color: #ff7a59;
    border: 2px solid #ff7a59;
}

.btn-outline:hover {
    background: #ff7a59;
    color: white;
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: #10b981;
    color: white;
}

.badge-hot {
    background: #ef4444;
    color: white;
}

.badge-trending {
    background: #f59e0b;
    color: white;
}

/* 分隔线 */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 30px 0;
}

/* 卡片阴影效果 */
.card-shadow-sm {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

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

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

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
} 