/* 罗彦怡个人网页样式表 */

/* 图片懒加载和优化 */
img {
    loading: lazy;
    image-rendering: -webkit-optimize-contrast;
}

/* 平滑过渡 */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* 装饰性背景动画 */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.shape1 { width: 100px; height: 100px; top: 10%; left: 10%; animation-delay: 0s; }
.shape2 { width: 150px; height: 150px; top: 60%; right: 15%; animation-delay: 2s; }
.shape3 { width: 80px; height: 80px; bottom: 20%; left: 60%; animation-delay: 4s; }

/* 标题动画 */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animated-gradient-text {
    background: linear-gradient(90deg, #fff, #e0e9ff, #fff, #c7d2fe);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease infinite;
}

/* 照片卡片特效 */
.gallery-item {
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(129, 140, 248, 0.05));
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(102, 126, 234, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    border-radius: 0.75rem;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #818cf8, #a5b4fc);
    border-radius: 0.75rem;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 0.3;
}

/* 视频图标动画 */
.video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover .video-icon {
    background: rgba(255, 255, 255, 1);
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.video-icon::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid #667eea;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}

.dark .video-icon::before {
    border-left-color: #818cf8;
}

/* 模态框动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.modal {
    animation: fadeIn 0.3s;
}

#modalImg, #modalVideo {
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 留言表单动画 */
.message-form {
    animation: slideUp 0.4s ease-out;
}

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

/* 按钮波纹效果 */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:active::after {
    width: 300px;
    height: 300px;
}

/* 滚动淡入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 二维码卡片增强 */
.qr-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(10px);
}

.dark .qr-card {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.9), rgba(31, 41, 55, 0.9));
}

.qr-card:hover {
    transform: translateY(-5px);
}

/* Toast 通知动画 */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast {
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 输入框焦点效果 */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dark input:focus, .dark textarea:focus {
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

/* 标题装饰 */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #818cf8);
    border-radius: 2px;
}

/* 模态框关闭按钮增强 */
#closeModal {
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

#closeModal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* 平滑滚动行为 */
html {
    scroll-behavior: smooth;
}

/* 关于我部分样式增强 */
.about-section p {
    position: relative;
    padding-left: 20px;
}

.about-section p::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #667eea;
    font-size: 12px;
}

.dark .about-section p::before {
    color: #818cf8;
}
