* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #FAF8F5;
    --text-color: #3D2B1F;
    --accent-color: #E8927C;
    --accent-light: #F5D5C8;
    --card-bg: #FFFFFF;
    --shadow: rgba(61, 43, 31, 0.08);
    --skeleton-bg: #F0EDE8;
    --skeleton-shine: #E8E4DE;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Serif SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

.header {
    text-align: center;
    padding: 40px 0 32px;
    position: relative;
}

.header-decoration {
    margin-bottom: 16px;
}

.flower-icon {
    width: 40px;
    height: 40px;
    animation: gentleRotate 8s ease-in-out infinite;
}

@keyframes gentleRotate {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.title {
    font-family: 'Zhi Mang Xing', cursive;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-color);
    letter-spacing: 2px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--accent-color);
    letter-spacing: 4px;
    font-weight: 400;
}

.gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
    min-height: 100vh;
}

.photo-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 4/3;
}

.photo-card:nth-child(1) { animation-delay: 0.05s; }
.photo-card:nth-child(2) { animation-delay: 0.1s; }
.photo-card:nth-child(3) { animation-delay: 0.15s; }
.photo-card:nth-child(4) { animation-delay: 0.2s; }
.photo-card:nth-child(5) { animation-delay: 0.25s; }
.photo-card:nth-child(6) { animation-delay: 0.3s; }
.photo-card:nth-child(7) { animation-delay: 0.35s; }
.photo-card:nth-child(8) { animation-delay: 0.4s; }
.photo-card:nth-child(9) { animation-delay: 0.45s; }
.photo-card:nth-child(10) { animation-delay: 0.5s; }
.photo-card:nth-child(n+11) { animation-delay: 0.55s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.photo-card:active {
    transform: scale(0.98);
}

.skeleton-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--skeleton-bg) 25%, var(--skeleton-shine) 50%, var(--skeleton-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-img.loaded {
    opacity: 1;
}

.photo-number {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-family: 'Noto Serif SC', serif;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close:active {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:active {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
}

.lightbox-prev {
    left: 12px;
}

.lightbox-next {
    right: 12px;
}

.lightbox-content {
    position: relative;
    z-index: 1001;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 16px;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    border-radius: 12px;
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    margin-top: 16px;
    font-family: 'Noto Serif SC', serif;
}

@media (max-width: 380px) {
    .title {
        font-size: 1.9rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}

@media (hover: none) {
    .photo-card:hover img {
        transform: none;
    }
}
