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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #000;
    background: #fff;
    padding: 20px;
    overflow: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.header,
header {
    border-bottom: 2px solid #000;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header h1,
header h1 {
    font-size: 1.8em;
    margin-bottom: 6px;
    color: #000;
}

.header p,
header p {
    color: #444;
}

.subtitle {
    font-size: 1em;
    color: #444;
}

.content,
main {
    padding: 0;
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #ccc;
    margin-top: 40px;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.status-box {
    padding: 16px 20px;
    border-left: 4px solid;
    margin-bottom: 10px;
}

.status-box h2 {
    font-size: 1.2em;
    margin-bottom: 6px;
}

.status-box code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.status-completed {
    background: #f0fff0;
    border-color: #2a7a2a;
    color: #1a4a1a;
}

.status-failed {
    background: #fff0f0;
    border-color: #aa0000;
    color: #550000;
}

.results-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.results-gallery h3 {
    grid-column: 1 / -1;
}

.results-gallery h3 {
    font-size: 1.2em;
    color: #000;
    margin-bottom: 5px;
}

.result-item {
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 16px;
}

.result-item h4 {
    font-size: 1em;
    color: #000;
    margin-bottom: 10px;
}

.image-container {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px;
    margin-bottom: 10px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.9em;
    width: auto;
}

.btn-secondary {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}

.btn-secondary:hover {
    background: #000;
    color: #fff;
}

.log-section {
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.log-summary {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    color: #000;
    list-style: none;
    user-select: none;
}

.log-summary:hover {
    background: #eee;
}

.log-content {
    padding: 0 16px 16px;
}

.log-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.85em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

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

.actions .btn {
    max-width: 300px;
}

.info-box {
    background: #f9f9f9;
    border-left: 4px solid #000;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.info-box h2 {
    color: #000;
    font-size: 1.1em;
    margin-bottom: 12px;
}

.info-box ul {
    margin-left: 20px;
}

.info-box ul li {
    margin: 6px 0;
}

.info-box code {
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.upload-area {
    border: 2px dashed #000;
    border-radius: 6px;
    padding: 40px 30px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    background: #fafafa;
    position: relative;
    margin-bottom: 20px;
}

.upload-area:hover {
    background: #f0f0f0;
}

.upload-area.drag-over {
    border-color: #2a7a2a;
    background: #f0fff0;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 1.1em;
    color: #000;
    margin-bottom: 8px;
}

.upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-list {
    margin: 16px 0;
}

.file-list h4 {
    margin-bottom: 8px;
    color: #000;
}

.file-list ul {
    list-style: none;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
}

.file-list ul li {
    padding: 6px;
    margin: 4px 0;
    background: #fff;
    border-radius: 3px;
    border-left: 3px solid #000;
}

.file-list ul li.invalid {
    border-left-color: #aa0000;
    background: #fff0f0;
}

.file-list .error {
    color: #aa0000;
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: 2px solid #000;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    width: 100%;
    background: #000;
    color: #fff;
}

.btn-primary {
    background: #000;
    color: #fff;
}

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

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

.progress-section {
    text-align: center;
    padding: 24px;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.progress-section h3 {
    margin-bottom: 16px;
    color: #000;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
}

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

.spinner {
    margin: 16px auto;
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 700px) {
    .upload-area {
        padding: 24px 16px;
    }

    .header h1 {
        font-size: 1.4em;
    }

    .results-gallery {
        grid-template-columns: 1fr;
    }
}
