/* 紫韵·星火 - 增强样式库 */

:root {
    --primary: #6366F1;
    --primary-light: #818CF8;
    --primary-dark: #4338CA;
    --secondary: #EC4899;
    --accent: #F59E0B;
    --success: #10B981;
    --bg-light: #F8FAFC;
    --bg-dark: #0F172A;
    --text-dark: #1E293B;
    --text-light: #64748B;
    --border-light: #E2E8F0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.25);
}

/* 全局优化 */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366F1, #818CF8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4338CA, #6366F1);
}

/* 增强的动画 */
@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

/* 增强的按钮样式 */
.btn-enhanced {
    position: relative;
    background: linear-gradient(135deg, #6366F1, #818CF8);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    overflow: hidden;
    cursor: pointer;
}

.btn-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.btn-enhanced:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #818CF8, #EC4899);
}

.btn-enhanced:hover::before {
    left: 100%;
}

.btn-enhanced:active {
    transform: translateY(-2px) scale(1.02);
}

/* 增强的卡片样式 */
.card-enhanced {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.card-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #6366F1, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-enhanced:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.15);
    border-color: #6366F1;
}

.card-enhanced:hover::before {
    opacity: 1;
}

/* 增强的图片样式 */
.image-enhanced {
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.image-enhanced::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-enhanced:hover {
    transform: scale(1.05) rotateY(5deg);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.25);
}

.image-enhanced:hover::before {
    opacity: 1;
}

.image-enhanced img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-enhanced:hover img {
    transform: scale(1.1);
}

/* 文字渐变效果 */
.text-gradient {
    background: linear-gradient(135deg, #6366F1, #EC4899, #F59E0B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-gradient-hover {
    background: linear-gradient(135deg, #6366F1, #EC4899);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background-position 0.3s ease;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 加载状态 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.6),
        transparent
    );
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 悬浮效果 */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 炫光边框 */
.border-glow {
    position: relative;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(45deg, #6366F1, #EC4899, #F59E0B, #6366F1);
    background-size: 300% 300%;
    animation: gradient-border 4s ease infinite;
}

.border-glow-content {
    background: white;
    border-radius: 0.9rem;
    padding: 1.5rem;
    height: 100%;
    width: 100%;
}

@keyframes gradient-border {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 响应式改进 */
@media (max-width: 768px) {
    .btn-enhanced {
        padding: 0.875rem 2rem;
        font-size: 0.95rem;
    }
    
    .card-enhanced {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .image-enhanced:hover {
        transform: scale(1.02);
    }
}

/* 打印优化 */
@media print {
    .btn-enhanced,
    .floating,
    .border-glow {
        animation: none !important;
        transform: none !important;
    }
    
    .card-enhanced {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* 可访问性改进 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .card-enhanced {
        border: 2px solid #000;
        background: #fff;
    }
    
    .btn-enhanced {
        border: 2px solid #000;
    }
}

/* 返回主页按钮样式 */
.btn-back-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-back-home:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.btn-back-home .icon {
    margin-right: 0.5rem;
}

/* 响应式图片容器 */
.img-responsive-container {
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}
