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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 40px 20px;
    color: #111111;
    font-weight: 400;
    line-height: 1.5;
}

.home-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    background: #ffffff;
    padding: 20px;
}

.home-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.logo-container {
    margin-bottom: 24px;
}

.home-logo {
    width: 260px;
    height: 260px;
    animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.home-title {
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: #111;
    margin-bottom: 8px;
}

.home-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
    margin-bottom: 30px;
}

.home-url-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.home-url-form input {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    background: #fafafa;
    transition: border-color 0.3s, background 0.3s;
}

.home-url-form input:focus {
    border-color: #111;
    background: #ffffff;
}

.home-url-form button {
    padding: 10px 24px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
    white-space: nowrap;
}

.home-url-form button:hover {
    background: #333;
}

.home-hint {
    margin-top: 16px;
    color: #aaa;
    font-size: 0.8rem;
}

.gallery-page {
    padding: 0;
}

header {
    max-width: 1400px;
    margin: 0 auto 40px auto;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
    position: relative;
}

.home-link-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home-link-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: 20px;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #111;
    font-weight: 300;
    font-size: 1.8rem;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.home-link:hover {
    opacity: 0.7;
}

.header-logo {
    width: 74px;
    height: 74px;
    display: block;
}

.search-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.search-btn:hover {
    opacity: 0.5;
    transform: scale(1.08);
}

.search-icon {
    width: 22px;
    height: 22px;
    display: block;
    stroke: #000;
}

.header-actions {
    position: absolute;
    right: 0;
}

.share-btn-prominent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    min-width: 170px;
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.share-btn-prominent:hover {
    background: #333333;
    transform: translateY(-1px);
}

.share-btn-prominent:active {
    transform: translateY(0);
}

.share-btn-prominent svg {
    stroke: #ffffff;
}

.share-menu {
    position: absolute;
    top: 48px;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 10px;
    min-width: 260px;
    z-index: 200;
    animation: menuFadeIn 0.2s ease;
}

@keyframes menuFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.share-menu-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    padding: 6px 10px 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 6px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
}

.share-option:hover {
    background: #f5f5f5;
}

.share-option .option-title {
    font-size: 0.85rem;
    font-weight: 400;
    color: #111;
    margin-bottom: 2px;
}

.share-option small {
    font-size: 0.72rem;
    color: #777;
    line-height: 1.3;
}

.folder-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
    padding: 4px 0;
}

.mode-indicator {
    display: none !important;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 8px;
}

.btn-back {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaaaaa;
    font-size: 1.2rem;
    font-weight: 400;
    transition: color 0.2s;
}

.btn-back:hover {
    color: #111111;
}

.current-folder {
    font-weight: 300;
    color: #111111;
    font-size: 1rem;
}

.album-caption {
    text-align: center;
    font-size: 0.9rem;
    font-weight: 400;
    color: #444;
    padding: 6px 16px;
    margin: 4px auto 8px;
    max-width: 800px;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    background: transparent;
    line-height: 1.5;
    display: none;
}

.album-caption:hover {
    border-color: #ddd;
}

.album-caption:focus {
    border-color: #111;
    background: #ffffff;
}

.album-caption.readonly {
    opacity: 0.7;
    cursor: default;
}

.album-caption.readonly:hover {
    border-color: transparent;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    background: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-photo {
    width: 100%;
    transition: transform 0.3s ease;
}

.card-photo:hover {
    transform: translateY(-4px);
}

.photo-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.daisy {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    margin-left: -24px;
    opacity: 1;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2;
    pointer-events: none;
}

.daisy img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    animation: spinDaisy 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.daisy.hidden {
    opacity: 0;
    transform: scale(0.7);
}

.photo-wrapper > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    position: relative;
}

.photo-wrapper > img.loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.video-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 3;
}

.photo-wrapper > img.loaded ~ .video-badge {
    opacity: 1;
}

.mac-folder-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInFolder 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.mac-folder {
    width: 110px;
    height: 85px;
    background: #f6f6f4;
    border: 1px solid #e1e1dc;
    border-radius: 6px;
    position: relative;
    box-shadow: inset 0 1px 0 #ffffff, 0 4px 12px rgba(0,0,0,0.02);
    transition: transform 0.2s ease;
}

.mac-folder::before {
    content: "";
    position: absolute;
    top: -7px;
    left: -1px;
    width: 35px;
    height: 7px;
    background: #f6f6f4;
    border: 1px solid #e1e1dc;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.folder-cover-inside {
    position: absolute;
    top: 12px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background-color: #ffffff;
    border: 1px solid #e8e8e3;
    border-radius: 3px;
    overflow: hidden;
}

.folder-cover-inside img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    position: relative;
}

.folder-cover-inside img.loaded {
    opacity: 0.9;
}

.mac-folder-wrapper:hover .mac-folder {
    transform: scale(1.03);
    background: #ffffff;
}

.folder-name {
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 400;
    color: #444;
    text-align: center;
    letter-spacing: 0;
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-caption {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 400;
    color: #333;
    text-align: center;
    width: 100%;
    padding: 4px 8px;
    border: 1px solid transparent;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    background: transparent;
    border-radius: 4px;
}

.photo-caption:hover {
    border-color: #ddd;
}

.photo-caption:focus {
    border-color: #111;
    background: #ffffff;
}

.photo-caption.readonly {
    opacity: 0.7;
    cursor: default;
}

.photo-caption.readonly:hover {
    border-color: transparent;
    background: transparent;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.99);
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.modal.active {
    display: flex;
}

.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
}

.modal-media-container {
    width: 100%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media-container img,
.modal-media-container video {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 36px;
    font-weight: 200;
    color: #111111;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 0.6;
}

.modal-actions {
    display: flex;
    gap: 16px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 10px 28px;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 20px;
}

.modal-btn:hover {
    background: #444444;
}

.notification-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 400;
    background: #111;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 9999;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification-toast.success {
    background: #111111;
}

.notification-toast.error {
    background: #e53e3e;
}

@keyframes fadeInFolder {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinDaisy {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
    body {
        padding: 20px 12px;
    }

    .home-title {
        font-size: 2.2rem;
        letter-spacing: 3px;
    }
    .home-logo {
        width: 180px;
        height: 180px;
    }
    .home-url-form {
        flex-direction: column;
    }

    .header-top {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
        padding: 0 4px;
    }
    .home-link-wrapper {
        flex: 1;
        order: 1;
    }
    .home-link-row {
        margin: 0;
        gap: 8px;
    }
    .header-logo {
        width: 40px;
        height: 40px;
    }
    .home-link {
        font-size: 1.1rem;
        gap: 6px;
    }
    .search-icon {
        width: 18px;
        height: 18px;
    }
    .header-actions {
        position: static;
        order: 2;
    }
    .share-btn-prominent {
        min-width: auto;
        padding: 6px 14px;
        font-size: 0.7rem;
        gap: 4px;
    }
    .share-btn-prominent span {
        display: none;
    }
    .share-btn-prominent svg {
        width: 18px;
        height: 18px;
    }
    .share-menu {
        right: 0;
        left: auto;
        min-width: 200px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 20px;
    }
    .folder-name,
    .photo-caption,
    .album-caption {
        font-size: 0.8rem;
    }
    .current-folder {
        font-size: 0.85rem;
    }
    .nav-container {
        font-size: 0.7rem;
        gap: 10px;
    }
    .btn-back {
        font-size: 1rem;
    }
    .modal {
        padding: 20px;
    }
    .modal-close {
        top: 16px;
        right: 20px;
        font-size: 28px;
    }
    .modal-btn {
        padding: 8px 16px;
        font-size: 0.65rem;
    }
    .notification-toast {
        bottom: 20px;
        padding: 10px 20px;
        font-size: 0.8rem;
        max-width: 90%;
        text-align: center;
    }
}