/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    overflow-x: hidden;
}

/* Header样式 */
.site-header {
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #c259ff 0%, #5d99ff 100%);
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    justify-content: center;
}

.header-image img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

@media (max-width: 768px) {
    .header-image img {
        max-height: 60px;
    }
}

/* 瀑布流容器 */
.masonry-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    transition: height 0.4s ease;
    margin-bottom: 80px;
}

/* 瀑布流项目 */
.masonry-item {
    position: absolute;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
    cursor: pointer;
}

.masonry-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.masonry-item:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* 图片容器 */
.item-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(45deg, #f5f7fa, #c3cfe2);
}

.item-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.masonry-item:hover .item-image img {
    transform: scale(1.05);
}

/* 图片加载占位符 */
.image-placeholder {
    width: 100%;
    background: linear-gradient(45deg, #f5f7fa, #c3cfe2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 14px;
}

/* 内容区域 */
.item-content {
    padding: 22px;
}

.item-date {
    display: inline-block;
    font-size: 13px;
    color: #5d99ff;
    font-weight: 600;
    margin-bottom: -20px;
    padding: -18px 10px;
    background: rgba(255, 107, 157, 0);
    border-radius: 20px;
    letter-spacing: 0px;
}

.item-title {
    font-size: 1.4rem;
    margin: 0 0 14px 0;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.item-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.item-title a:hover {
    color: #ff6b9d;
}

.item-description {
    font-size: 15px;
    color: #666;
    line-height: 1.7;
    margin: 0;
}

/* 链接样式 */
.item-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.item-link:hover {
    text-decoration: none;
}

/* 图片查看器模态框样式 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.image-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    color: white;
    border: none;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 1002;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-image-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
}

.modal-image {
    max-width: 90vw;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.image-caption {
    margin-top: 20px;
    color: white;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    line-height: 1.5;
}

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

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.6;
    }
}

/* 加载指示器 */
.loading-indicator {
    text-align: center;
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 107, 157, 0.2);
    border-top-color: #ff6b9d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 18px;
    color: #666;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-indicator.hidden {
    display: none;
}

/* 页面内容容器 */
.page-content {
    min-height: 100vh;
    position: relative;
}

/* 固定底部按钮样式 */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
    z-index: 100;
}

.home-button {
    padding: 12px 22px;
    background: linear-gradient(135deg, #c259ff 0%, #5d99ff 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(37, 117, 252, 0.4);
    transition: all 0.3s ease;
    text-decoration: none;
}

.home-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 117, 252, 0.6);
}

.home-button:active {
    transform: translateY(-1px);
}

.home-button i {
    margin-right: 0px;
}

/* 响应式设计 - 基础断点 */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 2rem;
    }
    
    .site-header p {
        font-size: 1rem;
    }
    
    .item-content {
        padding: 18px;
    }
    
    .item-title {
        font-size: 1.2rem;
    }
    
    .item-description {
        font-size: 14px;
    }
    
    .masonry-container {
        padding: 15px;
    }
    
    .modal-image {
        max-width: 95vw;
        max-height: 60vh;
    }
    
    .image-caption {
        font-size: 14px;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 20px 15px;
    }
    
    .site-header h1 {
        font-size: 1.7rem;
    }
    
    .masonry-container {
        padding: 10px;
    }
    
    .item-content {
        padding: 15px;
    }
    
    .modal-close {
        top: -35px;
        right: -10px;
        font-size: 28px;
    }
    
    .image-caption {
        font-size: 13px;
        margin-top: 15px;
    }
}

/* 工具提示 */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.tooltip.visible {
    opacity: 1;
}

/* 滚动到顶部按钮 */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #c259ff 0%, #5d99ff 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    background: #ff5588;
    transform: translateY(-3px);
    box-shadow: 3 3px 8px rgba(255, 107, 157, 0.4);
}

/* 性能优化 */
.masonry-item {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 打印样式 */
@media print {
    .site-header, .site-footer, .scroll-top-btn {
        display: none;
    }
    
    .masonry-item {
        position: static !important;
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .image-modal {
        display: none !important;
    }
}