@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400&family=Space+Mono&display=swap');

:root {
    --pearl-white: #f8f9fa;
    --light-gray: #e9ecef;
    --muted-gold: #d4af37;
    --muted-gold-transparent: rgba(212, 175, 55, 0.2);
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    background-color: var(--pearl-white);
    overflow-x: hidden;
    color: #333;
}

.mono {
    font-family: 'Space Mono', monospace;
}

.navbar {
    transform: translateY(0);
    transition: transform 0.3s ease-in-out, background-color 0.3s ease;
}

.navbar.hidden {
    transform: translateY(-100%);
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 20px;
    grid-auto-flow: dense;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
}

.image-container:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1), 0 0 8px var(--muted-gold-transparent);
    z-index: 1;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease;
}

.image-overlay {
    position: absolute;
    bottom: 20%;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 20px;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
    transform: translateY(0);
}

.filter-pills {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.pill {
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.pill:hover {
    transform: translateY(-2px);
}

.pill.active {
    background-color: var(--muted-gold);
    color: white;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    max-width: 80vw;
    max-height: 80vh;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-nav:hover {
    background: rgba(212, 175, 55, 0.5);
}

.modal-prev {
    left: -70px;
}

.modal-next {
    right: -70px;
}

/* 点击区域扩展 */
.modal-click-zone {
    position: absolute;
    top: 0;
    height: 100%;
    width: 10%;
    cursor: pointer;
    z-index: 5;
}

.modal-click-zone-left {
    left: 0;
}

.modal-click-zone-right {
    right: 0;
}

.hidden {
    display: none;
}

.modal-info {
    position: absolute;
    bottom: -70px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
}

.image-specs {
    position: absolute;
    bottom: 15px;
    left: 15px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    max-width: 80%;
}

.magnify-glass {
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    border: 2px solid var(--muted-gold);
    background-repeat: no-repeat;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: opacity 0.2s ease;
}

/* Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background-color: var(--muted-gold-transparent);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(100px, 100px);
    }
    50% {
        transform: translate(0, 200px);
    }
    75% {
        transform: translate(-100px, 100px);
    }
    100% {
        transform: translate(0, 0);
    }
}

/* Edge nav triggers */
.edge-trigger {
    position: fixed;
    top: 0;
    height: 100%;
    width: 40px;
    z-index: 20;
    opacity: 0;
}

.edge-trigger.left {
    left: 0;
}

.edge-trigger.right {
    right: 0;
}

/* 移动端响应式设计 */
@media (max-width: 768px) {
    /* 导航栏移动端样式 */
    .navbar {
        padding: 12px 16px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 12px;
    }
    
    .navbar h1 {
        font-size: 18px;
        text-align: center;
        width: 100%;
    }
    
    .navbar .space-x-6 {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        align-items: center;
    }
    
    .navbar .space-x-6 > div,
    .navbar .space-x-6 > span,
    .navbar .space-x-6 > a {
        margin: 0;
    }
    
    .navbar input[type="search"] {
        width: 100%;
        max-width: 280px;
        margin: 0;
    }
    
    /* 分类筛选移动端样式 */
    .filter-pills {
        bottom: 16px;
        left: 16px;
        right: 16px;
        padding: 0;
    }
    
    .filter-pills > div {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        padding: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filter-pills > div::-webkit-scrollbar {
        display: none;
    }
    
    .pill {
        font-size: 12px;
        padding: 8px 12px;
        border-radius: 20px;
        white-space: nowrap;
        min-width: auto;
        flex-shrink: 0;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .pill:active {
        transform: scale(0.95);
    }
    
    /* 网格布局移动端优化 */
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        grid-gap: 16px;
        padding: 0 16px;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        max-width: 95vw;
        max-height: 85vh;
        margin: 0 10px;
    }
    
    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .modal-prev {
        left: -50px;
    }
    
    .modal-next {
        right: -50px;
    }
    
    .modal-close {
        top: -35px;
        right: 5px;
        font-size: 20px;
    }
    
    .modal-info {
        bottom: -60px;
        font-size: 14px;
    }
    
    /* 关于我们和联系方式弹窗移动端优化 */
    .fixed .bg-white {
        margin: 16px;
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        border-radius: 12px;
    }
    
    /* 容器内边距调整 */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* 放大镜在移动端禁用 */
    .magnify-glass {
        display: none;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        grid-gap: 12px;
        padding: 0 12px;
    }
    
    .image-container {
        max-width: 100%;
    }
    
    .filter-pills {
        bottom: 12px;
        left: 12px;
        right: 12px;
    }
    
    .pill {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .navbar {
        padding: 10px 12px;
    }
    
    .navbar h1 {
        font-size: 16px;
    }
    
    .navbar input[type="search"] {
        max-width: 100%;
        font-size: 14px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .image-container:hover {
        transform: none;
        box-shadow: none;
    }
    
    .image-container:active {
        transform: scale(0.98);
    }
    
    .pill:hover {
        transform: none;
    }
    
    .pill:active {
        transform: scale(0.95);
        background-color: var(--muted-gold);
        color: white;
    }
    
    /* 移动端显示图片信息 */
    .image-overlay {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    }
}