/* ============================================
   照片墙溢出修复
   ============================================ */
#site-header, #page-header {
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

.photo-grid {
  width: 100vw !important;
  max-width: 100vw !important;
}
/* 针对照片墙容器的修复 - 照片墙自身需要 overflow: visible 以展示 200vw 宽度 */
.photo-grid {
  overflow: visible !important;
  width: 100%;
  max-width: 100vw;
}

#page-header .photo-grid-container {
  overflow: hidden !important;
  width: 100%;
  max-width: 100vw;
}

/* ============================================
   照片墙样式（保留原有）
   ============================================ */
.recent-post-item {
  transition: none !important;
}

.post_bg {
  transition: none !important;
}

#site-header.full_page {
    background-image: none !important;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100vw !important;
}

#site-header.full_page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f06, #9f6, #06f);
    z-index: 0;
}

.header-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/img/mask.png');
    background-size: cover;
    background-position: center;
    z-index: 1;
    pointer-events: none;
}

#site-header.full_page {
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.8s ease-in-out !important;
}

.photo-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--photo-columns, 14), var(--photo-tile-width, calc(100vw / 7))) !important;
    grid-template-rows: repeat(4, 25%) !important;
    grid-auto-flow: column !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1 !important;
    animation: gridScrollLeft 40s linear infinite;
    transition: opacity 0.5s ease;
}

.photo-grid.has-active {
    opacity: 0 !important;
    pointer-events: none !important;
}

@keyframes gridScrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.photo-tile {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    opacity: 0.5;
    transition: opacity 0.3s ease, filter 0.3s ease !important;
    cursor: pointer;
    will-change: filter;
    backface-visibility: hidden;
}

.photo-tile:hover {
    opacity: 1;
    transform: scale(1.05) translateZ(0);
}

#site-info {
    z-index: 10 !important;
    position: relative;
    pointer-events: none;
}

#site-title {
    font-size: 8rem !important;
    font-weight: 800 !important;
    letter-spacing: 5px;
    color: #fff !important;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5), 0 0 20px rgba(255,255,255,0.2) !important;
    font-family: 'Caveat', 'Quicksand', 'Montserrat Alternates', sans-serif !important;
    transition: color 0.3s ease;
    overflow: hidden;
    display: inline-block;
    white-space: nowrap;
    /* 初始状态：文字被隐藏，等待动画触发 */
    max-width: 0;
    opacity: 0;
}

/* 打字机动画 */
@keyframes typewriter {
    from { max-width: 0; opacity: 0; }
    10%  { opacity: 1; }
    to   { max-width: 100%; opacity: 1; }
}

/* .header-show-text 激活时触发打字机效果 */
.header-show-text #site-title {
    animation: typewriter 1.8s steps(20) forwards;
}

@media screen and (max-width: 768px) {
    #site-title {
        font-size: 3rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-grid {
        animation: none !important;
    }

    .photo-tile {
        transition: none !important;
    }
}

#site-info {
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s ease-in-out !important;
    z-index: 10 !important;
    position: relative;
}

#page-header.full_page:has(.has-active) #site-info {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0);
}

.header-show-text #site-info {
    opacity: 1 !important;
    visibility: visible !important;
}


