* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 30%, #0f172a 70%, #1e293b 100%);
    background-attachment: fixed;
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

header {
    text-align: center;
    padding: 32px 0 40px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 40px;
}

header h1 {
    margin: 0 0 12px;
    font-size: 40px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 30%, #f472b6 60%, #fb923c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #94a3b8;
    margin: 0;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 32px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    backdrop-filter: blur(10px);
}

.tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 14px 24px;
    font-size: 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s;
    font-weight: 500;
    flex: 1;
    position: relative;
}

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

.tab-btn.active {
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.tab-panel {
    display: none;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tab-panel.active {
    display: block;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin: 0 0 24px;
    color: #f1f5f9;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #60a5fa 0%, #8b5cf6 100%);
    border-radius: 2px;
}

h3 {
    margin: 28px 0 14px;
    color: #cbd5e1;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

h3::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #60a5fa;
    border-radius: 50%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row.full {
    grid-column: 1 / -1;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.25s;
    backdrop-filter: blur(10px);
}

.form-row select option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 8px 12px;
}

.form-row select option:hover {
    background: #3b82f6;
    color: white;
}

.form-row select option:checked {
    background: #3b82f6;
    color: white;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
    background: rgba(255, 255, 255, 0.05);
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
    font-family: "SF Mono", Consolas, Monaco, monospace;
}

.form-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: #60a5fa;
    cursor: pointer;
    vertical-align: middle;
}

.form-row input[type="file"] {
    border: 2px dashed rgba(148, 163, 184, 0.2);
    cursor: pointer;
}

.form-row input[type="file"]:hover {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.05);
}

.form-row input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
}

.hint {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 6px;
    font-style: italic;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(148, 163, 184, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.status {
    margin-left: 16px;
    font-size: 14px;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status.error { color: #f87171; }
.status.error::before { background: #f87171; animation: pulse 1.5s infinite; }

.status.success { color: #34d399; }
.status.success::before { background: #34d399; }

.status.pending { color: #fbbf24; }
.status.pending::before { background: #fbbf24; animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.result-box {
    margin-top: 32px;
    padding: 24px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.hidden { display: none; }
.result-box.hidden { display: none; }

.result-box h3 {
    margin: 0 0 16px;
    color: #f1f5f9;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-box h3::before {
    display: none;
}

.result-box pre {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    color: #94a3b8;
    max-height: 350px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.poll-box {
    margin-top: 20px;
    padding: 20px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.poll-box.hidden { display: none; }

.poll-box p {
    margin: 8px 0;
    font-size: 14px;
    color: #cbd5e1;
}

.poll-box p span {
    color: #f1f5f9;
    font-weight: 600;
}

.logs {
    margin: 16px 0;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: 12px;
    color: #64748b;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    min-height: 50px;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.list-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.25s;
}

.list-item:hover {
    border-color: rgba(96, 165, 250, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.list-item-title {
    color: #f1f5f9;
    font-weight: 600;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-engine { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.badge-success { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.badge-pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.badge-running { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.badge-failed { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.badge-ready { background: rgba(16, 185, 129, 0.15); color: #10b981; }

.list-item-meta {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.list-item-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

.list-item-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.empty-state {
    padding: 60px;
    text-align: center;
    color: #64748b;
    font-size: 15px;
}

.empty-state::before {
    content: '📦';
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.5;
}

footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

footer code {
    background: rgba(15, 23, 42, 0.8);
    padding: 4px 12px;
    border-radius: 6px;
    color: #94a3b8;
    font-family: "SF Mono", Consolas, Monaco, monospace;
    font-size: 12px;
}

.muted { color: #64748b; margin-top: 8px; }

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px 48px;
    }
    
    header h1 {
        font-size: 28px;
    }
    
    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .tab-panel {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .list-item-header {
        flex-direction: column;
        align-items: flex-start;
    }
}