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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
    color: #000000;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

header {
    background: #000000;
    color: #ffffff;
    padding: 40px 30px;
    text-align: center;
    border-bottom: 2px solid #000000;
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 400;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

header h1 svg {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    stroke: #ffffff;
    flex-shrink: 0;
}

.subtitle {
    color: #888888;
    font-size: 0.9rem;
    font-weight: 300;
}

.auth-section {
    padding: 60px 40px;
}

.auth-box {
    max-width: 400px;
    margin: 0 auto;
}

.auth-box h2 {
    margin-bottom: 30px;
    color: #000000;
    font-size: 1.25rem;
    font-weight: 400;
    text-align: center;
}

.auth-box input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 2px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
    background: #ffffff;
    color: #000000;
}

.auth-box input:focus {
    outline: none;
    border-color: #0066cc;
}

.auth-box input::placeholder {
    color: #999999;
}

.upload-section {
    padding: 40px 30px;
}

.existing-images-section {
    margin-bottom: 50px;
}

.existing-images-section h2 {
    color: #000000;
    margin-bottom: 24px;
    font-size: 1.1rem;
    font-weight: 400;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.existing-images-section h2 svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
    max-height: 16px;
    stroke: #000000;
    flex-shrink: 0;
}

.existing-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.existing-image-item {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    background: #ffffff;
    transition: border-color 0.2s;
}

.existing-image-item:hover {
    border-color: #d0d0d0;
}

.existing-image-item:hover .delete-image-btn {
    opacity: 1;
    visibility: visible;
}

.delete-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 2px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0;
    visibility: hidden;
    z-index: 10;
    padding: 0;
}

.delete-image-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.delete-image-btn svg {
    width: 16px;
    height: 16px;
    stroke: #ffffff;
}

.existing-image-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.existing-image-name {
    padding: 12px;
    font-size: 0.85rem;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
    border-top: 1px solid #f5f5f5;
}

.existing-image-size {
    padding: 0 12px 12px 12px;
    font-size: 0.75rem;
    color: #666666;
}

.loading, .no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #666666;
    font-size: 0.9rem;
}

.upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 2px;
    padding: 60px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area:hover {
    border-color: #0066cc;
    background: #f5f5f5;
}

.upload-area.drag-over {
    border-color: #0066cc;
    background: #f0f0f0;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    color: #666666;
    margin: 0 auto 20px;
    stroke: #666666;
    display: block;
    flex-shrink: 0;
}

.upload-area:hover .upload-icon {
    stroke: #0066cc;
}

.upload-area h2 {
    color: #000000;
    margin-bottom: 8px;
    font-size: 1.1rem;
    font-weight: 400;
}

.upload-area p {
    color: #666666;
    margin: 8px 0;
    font-size: 0.9rem;
}

.file-info {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #999999;
}

.btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 400;
    border: 1px solid #000000;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
    color: #000000;
    text-transform: none;
    letter-spacing: 0;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-primary:hover:not(:disabled) {
    background: #333333;
    border-color: #333333;
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #000000;
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
    border-color: #d0d0d0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #999999;
}

.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.preview-item {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    background: #ffffff;
}

.preview-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.preview-item .remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 2px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.preview-item .remove-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.preview-item .remove-btn svg {
    width: 14px;
    height: 14px;
    stroke: #ffffff;
}

.preview-item .file-name {
    padding: 10px;
    font-size: 0.8rem;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid #f5f5f5;
}

.upload-progress {
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: #0066cc;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    color: #666666;
    font-size: 0.85rem;
}

.upload-results {
    margin-bottom: 20px;
    min-height: 50px;
}

.success-message {
    background: #f0f8ff;
    color: #0066cc;
    padding: 12px 16px;
    border-radius: 2px;
    margin-bottom: 10px;
    border-left: 3px solid #0066cc;
    font-size: 0.9rem;
}

.error-message {
    background: #fff5f5;
    color: #cc4400;
    padding: 12px 16px;
    border-radius: 2px;
    margin-bottom: 10px;
    border-left: 3px solid #ff6600;
    font-size: 0.9rem;
}

.actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-form {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.logout-form .btn {
    border-color: #d0d0d0;
    color: #666666;
}

.logout-form .btn:hover {
    background: #f5f5f5;
    border-color: #999999;
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .upload-section {
        padding: 30px 20px;
    }
    
    .auth-section {
        padding: 40px 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    .file-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .existing-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .existing-image-item img {
        height: 120px;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
