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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: clamp(16px, 2.5vw, 24px) clamp(24px, 4vw, 48px) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.top-bar .masl-link {
    position: absolute;
    left: clamp(24px, 4vw, 48px);
    top: clamp(16px, 2.5vw, 24px);
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.top-bar .masl-link:hover {
    color: #fff;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: clamp(24px, 4vw, 40px) clamp(24px, 4vw, 48px);
}

.content-container {
    max-width: min(1400px, 100%);
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #ffffff;
    margin: 0 0 clamp(12px, 2vw, 16px) 0;
    font-size: clamp(1.75em, 4vw, 2.5em);
    font-weight: 700;
    letter-spacing: -1px;
}

.description {
    text-align: center;
    color: #666;
    margin-top: clamp(48px, 6vw, 64px);
    padding-top: clamp(24px, 4vw, 32px);
    border-top: 1px solid #2a2a2a;
    font-size: clamp(12px, 1.3vw, 14px);
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.description a {
    color: #4a9eff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.description a:hover {
    color: #3a8eef;
    text-decoration: underline;
}

.tabs {
    display: flex;
    gap: 0;
    margin: 0;
    border-bottom: 1px solid #2a2a2a;
    justify-content: center;
    margin-top: clamp(12px, 2vw, 16px);
}

.tab-btn {
    padding: clamp(12px, 2vw, 16px) clamp(24px, 3vw, 32px);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: clamp(14px, 1.5vw, 15px);
    font-weight: 500;
    color: #888;
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
    color: #ffffff;
    border-bottom-color: #4a9eff;
}

.tab-content {
    display: none;
    margin: 0;
    padding: 0;
}

.tab-content.active {
    display: block;
}

.upload-area {
    margin-bottom: clamp(24px, 4vw, 32px);
}

.file-label {
    display: inline-block;
    margin-bottom: clamp(16px, 3vw, 20px);
    text-align: center;
    width: auto;
}

.file-label-wrapper {
    display: block;
    text-align: center;
    margin-bottom: clamp(16px, 3vw, 20px);
}

.file-label span {
    display: inline-block;
    padding: clamp(14px, 2vw, 16px) clamp(24px, 3vw, 32px);
    background: #4a9eff;
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: clamp(14px, 1.5vw, 15px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.file-label span:hover {
    background: #3a8eef;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
}

.file-label input[type="file"] {
    display: none;
}

#submit-btn {
    width: 100%;
    padding: clamp(14px, 2vw, 16px);
    background: #4a9eff;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: clamp(15px, 1.8vw, 16px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
    margin-top: clamp(20px, 3vw, 24px);
}

#submit-btn:hover:not(:disabled) {
    background: #3a8eef;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 158, 255, 0.4);
}

#submit-btn:disabled {
    background: #2a2a2a !important;
    color: #666 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.6;
}

.preview {
    margin-top: clamp(24px, 4vw, 32px);
    text-align: center;
}

.preview img {
    max-width: 100%;
    max-height: min(600px, 70vh);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2a2a;
}

.result {
    margin-top: clamp(24px, 4vw, 32px);
    padding: clamp(20px, 3vw, 28px);
    background: #252525;
    border-radius: 16px;
    min-height: 50px;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: none;
    color: #e0e0e0;
    line-height: 1.7;
    border: 1px solid #2a2a2a;
    font-size: clamp(14px, 1.5vw, 15px);
}

.result.show {
    display: block;
}

.error {
    margin-top: clamp(20px, 3vw, 24px);
    padding: clamp(16px, 2.5vw, 18px) clamp(20px, 3vw, 24px);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 12px;
    border-left: 3px solid #ef4444;
    display: none;
    font-size: clamp(13px, 1.4vw, 14px);
}

.error.show {
    display: block;
}

.queue-status {
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(74, 158, 255, 0.1);
    color: #4a9eff;
    border-radius: 12px;
    border-left: 3px solid #4a9eff;
    text-align: center;
    font-weight: 500;
}

.loading {
    text-align: center;
    color: #4a9eff;
    font-weight: 500;
    padding: clamp(40px, 6vw, 60px) clamp(16px, 3vw, 20px);
    font-size: clamp(15px, 1.8vw, 16px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(280px, 30vw, 320px), 1fr));
    gap: clamp(16px, 2.5vw, 24px);
    margin: 0;
    padding: 0;
}

.gallery-item {
    background: #252525;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid #2a2a2a;
    width: 100%;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border-color: #3a3a3a;
}

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

.gallery-item-content {
    padding: clamp(20px, 3vw, 24px);
    margin: 0;
}

.gallery-item-description {
    color: #e0e0e0;
    font-size: clamp(13px, 1.4vw, 14px);
    line-height: 1.7;
    margin-bottom: clamp(12px, 2vw, 16px);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.gallery-item-time {
    color: #888;
    font-size: clamp(11px, 1.2vw, 12px);
    font-weight: 500;
}

.gallery-empty {
    text-align: center;
    padding: clamp(60px, 8vw, 80px) clamp(16px, 3vw, 20px);
    color: #888;
    font-size: clamp(15px, 1.8vw, 16px);
}

@media (max-width: 768px) {
    .top-bar {
        padding: 16px 20px;
    }
    
    .content-wrapper {
        padding: 20px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1920px) {
    .content-container {
        max-width: 1600px;
    }
}
