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

body {
    min-height: 100vh;
    background-image: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.nav {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 56px;
}

.nav-brand {
    font-size: 22px;
    font-weight: 700;
    color: #2d6a4f;
    text-decoration: none;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand::before {
    content: '📷';
    font-size: 20px;
}

.nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav ul li a {
    text-decoration: none;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 18px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav ul li a:hover {
    background-color: #e8f5e9;
    color: #2d6a4f;
}

.nav ul li a.nav-active {
    background-color: #2d6a4f;
    color: #fff;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 4px;
}

.search {
    max-width: 700px;
    margin: 20px auto;
    padding: 0 20px;
    display: flex;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.search .select-city {
    height: 44px;
    padding: 0 12px;
    border: none;
    outline: none;
    background-color: #fff;
    font-size: 14px;
    min-width: 90px;
    cursor: pointer;
    border-right: 1px solid #e0e0e0;
}

.search input {
    flex: 1;
    height: 44px;
    padding: 0 16px;
    border: none;
    outline: none;
    background-color: #fff;
    font-size: 14px;
    min-width: 0;
}

.search input::placeholder {
    color: #aaa;
}

.search button {
    height: 44px;
    padding: 0 24px;
    background-color: #a7d3b2;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search button:hover {
    background-color: #86a289;
}

.bgm {
    position: fixed;
    top: 76px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 90;
    transition: all 0.3s ease;
}

.bgm:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

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

.bgm i {
    font-size: 22px;
    color: #2d6a4f;
}

.bgm.playing {
    animation: rotate 3s linear infinite;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px 40px;
}

.show {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.show li {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background-color: #e0e4e8;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.show li::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #e0e4e8 25%, #eceef0 50%, #e0e4e8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.show li.loaded::before {
    opacity: 0;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.show li:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.show li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.4s ease;
    opacity: 0;
    position: relative;
    z-index: 2;
}

.show li.loaded img {
    opacity: 1;
}

.show li:hover img {
    transform: scale(1.05);
}

.show li.img-error {
    cursor: default;
}

.show li.img-error::after {
    content: '🖼️ 图片加载失败';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    background: #f0f0f0;
    z-index: 3;
}

.show li.img-error::before {
    display: none;
}

.show li.video {
    cursor: default;
}

.show li.video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.show li.video::before {
    display: none;
}

.show li.video:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.show li.empty {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: none;
    cursor: default;
}

.show li.empty::before {
    display: none;
}

.show li.empty:hover {
    transform: none;
    box-shadow: none;
}

.show li.empty img {
    max-width: 300px;
    border-radius: 12px;
    opacity: 1;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    transition: opacity 0.3s ease;
}

.lightbox img.loading {
    opacity: 0.3;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.result-info {
    text-align: center;
    padding: 8px 20px;
    color: #555;
    font-size: 14px;
}

@media (max-width: 768px) {
    .nav-inner {
        position: relative;
    }

    .nav-toggle {
        display: block;
    }

    .nav ul {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 12px 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        gap: 0;
    }

    .nav ul.open {
        display: flex;
    }

    .nav ul li {
        width: 100%;
        text-align: center;
    }

    .nav ul li a {
        display: block;
        padding: 12px 20px;
        border-radius: 0;
    }

    .search {
        flex-wrap: wrap;
        border-radius: 12px;
    }

    .search .select-city {
        width: 100%;
        height: 40px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        border-radius: 0;
    }

    .search input {
        flex: 1;
        height: 40px;
        border-radius: 0;
    }

    .search button {
        height: 40px;
        padding: 0 16px;
    }

    .bgm {
        top: auto;
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .bgm i {
        font-size: 24px;
    }

    .show {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }

    .show li {
        border-radius: 8px;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .lightbox-prev {
        left: 8px;
    }

    .lightbox-next {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .show {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .nav-brand {
        font-size: 18px;
    }
}

.login-box {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 28px;
    color: #2d6a4f;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.login-header p {
    color: #888;
    font-size: 14px;
}

.login-form {
    width: 100%;
    max-width: 340px;
}

.login-input-wrap {
    margin-bottom: 20px;
}

.login-input-wrap input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.login-input-wrap input:focus {
    border-color: #2d6a4f;
}

.login-error {
    display: block;
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    min-height: 20px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background-color: #2d6a4f;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 2px;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background-color: #1b4332;
}
