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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 560px;
    padding: 24px;
}

header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.subtitle {
    color: #8b949e;
    margin-top: 4px;
    font-size: 14px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 32px;
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #fff;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #8b949e;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #e1e4e8;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #58a6ff;
}

.btn {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: #2ea043;
}

.btn-secondary {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #30363d;
}

.btn-link {
    background: none;
    border: none;
    color: #f85149;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.error-text {
    color: #f85149;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #30363d;
    border-radius: 12px;
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.05);
}

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

.upload-zone p {
    color: #8b949e;
    font-size: 14px;
}

.hint {
    font-size: 12px !important;
    margin-top: 8px;
    color: #484f58 !important;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

#file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#file-size {
    color: #8b949e;
    font-size: 12px;
}

/* Progress */
.progress-container {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #21262d;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #238636, #3fb950);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    color: #8b949e;
    font-size: 14px;
}

.progress-pct {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin: 16px 0;
}

.stage-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #21262d;
    font-size: 13px;
    color: #484f58;
}

/* Debug log */
.debug-log {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #21262d;
}

.debug-log h3 {
    font-size: 13px;
    color: #8b949e;
    margin-bottom: 8px;
    font-weight: 600;
}

.log-entries {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.log-entries .log-entry {
    color: #8b949e;
    padding: 2px 0;
    border-bottom: 1px solid #161b22;
}

.log-entries .log-entry:last-child {
    border-bottom: none;
    color: #3fb950;
}

.log-entries .log-time {
    color: #484f58;
    margin-right: 8px;
}

/* Result */
.success-icon,
.error-icon {
    font-size: 64px;
    text-align: center;
    margin: 16px 0;
}

@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 24px 18px;
    }

    .upload-zone {
        padding: 24px 16px;
    }
}
