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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f0f0;
    min-height: 100vh;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1.brand {
    font-weight: 900;
    color: #8b0000;
    letter-spacing: 2px;
    display: flex;
    align-items: baseline;
    white-space: nowrap;
    flex-shrink: 0;
}
header h1.brand span { font-weight: 900; }

.brand-repeat {
    display: none;
}

.color-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: 16px;
    overflow: hidden;
    height: 20px;
}

.color-dot {
    flex: 1;
    height: 100%;
    min-width: 4px;
    border-radius: 2px;
    transition: transform 0.2s, height 0.2s;
    cursor: pointer;
}

.color-dot:hover {
    transform: scaleY(1.8);
}
header nav a {
    margin-left: 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}
header nav a:hover { color: #e60023; }

.masonry {
    columns: 5;
    column-gap: 12px;
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.6s ease-in, opacity 0.4s ease-in;
}

.masonry-item.fall-away {
    visibility: hidden;
}

.masonry-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

@media (max-width: 1200px) { .masonry { columns: 4; } }
@media (max-width: 900px) { .masonry { columns: 3; } }
@media (max-width: 600px) { .masonry { columns: 2; column-gap: 8px; padding: 12px; } }

.empty {
    text-align: center;
    padding: 80px 20px;
    color: #999;
    font-size: 1.1rem;
}

.login-box {
    max-width: 360px;
    margin: 120px auto;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.login-box h2 { margin-bottom: 24px; text-align: center; }
.login-box input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #e60023;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}

.login-box button:hover { background: #c4001d; }
.error { color: #e60023; text-align: center; margin-bottom: 12px; }

.admin-panel { padding: 24px; max-width: 1200px; margin: 0 auto; }
.upload-section { margin-bottom: 32px; }
.upload-section h2 { margin-bottom: 12px; }

.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #e60023;
    background: #fff5f5;
}

.upload-area input { display: none; }
#uploadProgress { margin-top: 12px; color: #666; }

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.admin-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.admin-item img { width: 100%; height: 150px; object-fit: cover; }
.item-info { padding: 8px; font-size: 0.8rem; color: #666; }
.item-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-delete {
    margin-top: 6px;
    padding: 4px 10px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-delete:hover { background: #d9363e; }
