* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: rgb(50, 50, 50);
    min-height: 100vh;
    padding-bottom: 40px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 12px;
    font-size: 1.4em;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.header-column {
    background: rgba(102, 126, 234, 0.08);
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.header-column h3 {
    color: #667eea;
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 600;
}

.header-column p {
    color: #444;
    font-size: 0.8em;
    line-height: 1.5;
    margin: 0;
}

.header-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 10px;
}

.header-column ul li {
    color: #444;
    font-size: 0.75em;
    line-height: 1.3;
    padding: 0;
}

.contact-info {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.contact-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85em;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.count {
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 18px;
    border-radius: 20px;
    color: #667eea;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    color: white;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.loading.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 控制器 - 移到顶栏内 */
#controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#slider {
    width: 120px;
    height: 5px;
    cursor: pointer;
    flex: 1;
}

#slider-value {
    color: #667eea;
    font-weight: 600;
    font-size: 1.2em;
    min-width: 25px;
    text-align: center;
}

/* 瀑布流容器 - 改用相对定位 */
.waterfall-container {
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
}

/* 瀑布流项目 - 改用绝对定位 */
.waterfall-item {
    position: absolute;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.2s;
    cursor: pointer;
    animation: fadeIn 0.5s ease;
}

.waterfall-item:hover {
    transform: scale(1.02);
}

.waterfall-item img {
    width: 100%;
    height: auto;
    display: block;
}

.waterfall-item .image-info {
    padding: 12px;
    background: white;
}

.waterfall-item .image-name {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.waterfall-item .image-size {
    font-size: 0.75em;
    color: #999;
    margin-top: 4px;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .waterfall-container {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .waterfall-container {
        padding: 10px;
    }

    #slider {
        width: 80px;
    }

    header {
        padding: 8px 12px;
    }

    h1 {
        font-size: 1em;
        margin-bottom: 8px;
    }

    .header-content {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .header-column {
        padding: 8px 10px;
    }

    .header-column h3 {
        font-size: 0.75em;
        margin-bottom: 4px;
    }

    .header-column p {
        font-size: 0.7em;
        line-height: 1.4;
    }

    .header-column ul {
        grid-template-columns: 1fr 1fr;
        gap: 1px 8px;
    }

    .header-column ul li {
        font-size: 0.65em;
        line-height: 1.4;
        padding: 1px 0;
    }

    .contact-info {
        height: auto;
        justify-content: flex-start;
    }

    .contact-info a {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .waterfall-container {
        column-count: 2;
        padding: 10px;
        column-gap: 10px;
    }

    header {
        padding: 6px 10px;
    }

    h1 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }

    .header-content {
        gap: 6px;
    }

    .header-column {
        padding: 6px 8px;
    }

    .header-column h3 {
        font-size: 0.7em;
        margin-bottom: 3px;
    }

    .header-column p {
        font-size: 0.65em;
        line-height: 1.3;
    }

    .header-column ul {
        grid-template-columns: 1fr 1fr;
        gap: 0px 6px;
    }

    .header-column ul li {
        font-size: 0.6em;
        line-height: 1.3;
        padding: 0;
    }

    .contact-info {
        height: auto;
        justify-content: flex-start;
    }

    .contact-info a {
        font-size: 0.65em;
    }
}

/* 灯箱效果 */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.lightbox.hidden {
    display: none;
}

.lightbox:not(.hidden) {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

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

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1001;
}

.close:hover {
    color: #bbb;
}

.lightbox-caption {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 20px;
    max-width: 80%;
}

.lightbox-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 15px;
    font-size: 0.85em;
    z-index: 1001;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nav-btn.prev {
    left: 20px;
}

.nav-btn.next {
    right: 20px;
}

/* 灯箱响应式 */
@media (max-width: 768px) {
    .lightbox-hint {
        font-size: 0.75em;
        padding: 5px 12px;
    }

    .lightbox-caption {
        font-size: 0.85em;
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .lightbox-hint {
        font-size: 0.7em;
        padding: 4px 10px;
        bottom: 10px;
    }

    .lightbox-caption {
        bottom: 40px;
        font-size: 0.8em;
        padding: 6px 12px;
    }

    .nav-btn {
        font-size: 24px;
        padding: 10px 15px;
    }
}

