/* SuCos 博客系统 - 基础UI增强样式 */

/* ==================== Toast 通知系统 ==================== */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    max-width: 380px;
}

.toast-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { border-left: 4px solid #52c41a; }
.toast-error { border-left: 4px solid #ff4d4f; }
.toast-info { border-left: 4px solid #1890ff; }
.toast-warning { border-left: 4px solid #faad14; }

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
}

.toast-content i {
    font-size: 1.4rem;
}

.toast-success i { color: #52c41a; }
.toast-error i { color: #ff4d4f; }
.toast-info i { color: #1890ff; }
.toast-warning i { color: #faad14; }

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-dark);
}

/* 移动端Toast优化 */
@media (max-width: 576px) {
    #toast-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ==================== 空状态优化 ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #FFEBCD 0%, #FFB347 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.empty-state-icon i {
    font-size: 3.5rem;
    color: white;
    opacity: 0.9;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.empty-state-title {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.empty-state-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.empty-state-tips {
    background: var(--cream-light);
    border-radius: 8px;
    padding: 1rem;
    display: inline-block;
}

/* ==================== 按钮增强 ==================== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

.btn-orange.btn-loading::after {
    border-color: white;
    border-top-color: transparent;
}

/* ==================== 卡片增强 ==================== */
.card-hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(139, 115, 85, 0.2);
}

.card-gradient-border {
    border: none;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--orange-warm), var(--brown-light)) border-box;
    border: 2px solid transparent;
}

/* ==================== 表单验证样式 ==================== */
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    animation: shake 0.3s;
}

.form-control.is-valid {
    border-color: #28a745;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: fadeIn 0.3s;
}

.valid-feedback {
    display: block;
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    animation: fadeIn 0.3s;
}

/* ==================== 骨架屏 ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-article {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.skeleton-line {
    height: 1rem;
    background: var(--cream-dark);
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

.skeleton-line.w-100 { width: 100%; }
.skeleton-line.w-90 { width: 90%; }
.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-50 { width: 50%; }

.skeleton-title {
    height: 1.8rem;
    width: 70%;
    margin-bottom: 1.2rem;
}

.skeleton-image {
    height: 200px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ==================== 加载状态 ==================== */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 248, 220, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--cream-dark);
    border-top-color: var(--orange-warm);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== 图片加载效果 ==================== */
img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s ease;
}

img.img-loaded {
    filter: blur(0);
}

.img-loading::before {
    content: '';
    display: block;
    padding-top: 66.67%; /* 16:9 aspect ratio */
    background: var(--cream-dark);
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ==================== 滚动条美化 ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cream-light);
}

::-webkit-scrollbar-thumb {
    background: var(--cream-dark);
    border-radius: 5px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--orange-warm);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--cream-dark) var(--cream-light);
}

/* ==================== 复制成功提示 ==================== */
.copy-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.copy-toast i {
    color: #52c41a;
}

