* { box-sizing: border-box; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1e293b; }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

body { margin: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; background: #0f172a; color: #e2e8f0; }

.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.slide-in { animation: slideIn 0.3s ease-out; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 20px; height: 20px; border: 2px solid #475569; border-top-color: #818cf8; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.skeleton { background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@keyframes progress { 0% { width: 0%; } }
.progress-bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 0.5s ease; }

.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 9999; animation: slideIn 0.3s ease-out; max-width: 400px; }
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }

.drop-zone { border: 2px dashed #475569; border-radius: 12px; padding: 32px; text-align: center; cursor: pointer; transition: all 0.2s; }
.drop-zone:hover, .drop-zone.dragover { border-color: #818cf8; background: rgba(99, 102, 241, 0.05); }

.tab-btn { position: relative; padding: 8px 16px; cursor: pointer; transition: color 0.2s; color: #94a3b8; background: none; border: none; font-size: 14px; font-weight: 500; }
.tab-btn.active { color: #818cf8; }
.tab-btn.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: #818cf8; border-radius: 1px; }

.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-primary:hover { transform: scale(1.02); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; padding: 8px 16px; border-radius: 8px; cursor: pointer; transition: all 0.2s; font-size: 14px; }
.btn-secondary:hover { background: #334155; }

.input-field { background: #1e293b; border: 1px solid #334155; color: #e2e8f0; padding: 10px 14px; border-radius: 8px; font-size: 14px; width: 100%; transition: border-color 0.2s; }
.input-field:focus { outline: none; border-color: #6366f1; }

textarea.input-field { resize: vertical; min-height: 100px; font-family: inherit; }

.card { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 24px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fbbf24; color: #000; }
.badge-processing, .badge-searching_gpu, .badge-creating_instance, .badge-downloading_model, .badge-uploading { background: #6366f1; color: #fff; }
.badge-done { background: #059669; color: #fff; }
.badge-error { background: #dc2626; color: #fff; }

.ratio-btn { padding: 6px 14px; border: 1px solid #334155; border-radius: 6px; background: #0f172a; color: #94a3b8; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.ratio-btn.active { border-color: #6366f1; color: #818cf8; background: rgba(99, 102, 241, 0.1); }

.duration-btn { padding: 6px 12px; border: 1px solid #334155; border-radius: 6px; background: #0f172a; color: #94a3b8; cursor: pointer; transition: all 0.2s; font-size: 13px; min-width: 44px; text-align: center; }
.duration-btn.active { border-color: #6366f1; color: #818cf8; background: rgba(99, 102, 241, 0.1); }

.style-btn { padding: 8px 16px; border: 1px solid #334155; border-radius: 8px; background: #0f172a; color: #94a3b8; cursor: pointer; transition: all 0.2s; font-size: 13px; }
.style-btn.active { border-color: #6366f1; color: #818cf8; background: rgba(99, 102, 241, 0.1); }

@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.open { display: flex; position: fixed; inset: 0; z-index: 50; }
  .main-content { margin-left: 0 !important; }
}
